From unknown Tue Sep 09 21:33:06 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#30810] [PATCH] gnu: java-jeromq: Fix tests. Resent-From: =?UTF-8?Q?G=C3=A1bor?= Boskovits Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 13 Mar 2018 21:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30810 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 30810@debbugs.gnu.org Cc: =?UTF-8?Q?G=C3=A1bor?= Boskovits X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15209780898206 (code B ref -1); Tue, 13 Mar 2018 21:55:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Mar 2018 21:54:49 +0000 Received: from localhost ([127.0.0.1]:60079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evrsa-00028C-MJ for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:54:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evrsX-00027x-7G for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:54:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evrsQ-0003DO-5X for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:54:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evrsQ-0003DK-1C for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:54:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evrsN-0003Su-SU for guix-patches@gnu.org; Tue, 13 Mar 2018 17:54:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evrsJ-0003BM-KG for guix-patches@gnu.org; Tue, 13 Mar 2018 17:54:31 -0400 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:36016) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1evrsJ-0003B2-9q for guix-patches@gnu.org; Tue, 13 Mar 2018 17:54:27 -0400 Received: by mail-wm0-x22f.google.com with SMTP id i194so691499wmg.1 for ; Tue, 13 Mar 2018 14:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/GiY/1NnjDcWgHMYMNcLHLKUU+3xoTMekZK793cniHI=; b=FO6Cfr32kOsm1zQ7Y1YGz2aFn2UNdaEXdJbz3ObjxxkzwgPGxk4TMjpok9/yAo+R4d /ewqIIwgZN9sbngoqLUBhX8FwvjUVCoEttzFcar+k37I81SPqjXg/5tnCdqdWZ7Di/Nx aLKS789wMIeuN6ayedgIJuMTWq6zcMwMZQBpMkZ2KVWvAXI0hasowOXNMoALlwbPlrqP WTYIDxIdroVWaHEn/PVut3LhrKkcfyzLbN3KuH3STmG5jpmFn7zJEYY7N6TIPFb1wOG9 5Xg3Fypt5pne7ZB3b9uVSp9Tok5msfcaVewsOkv8651iguS2zCV68qJ1Y0OF7r+VCeOJ S1vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/GiY/1NnjDcWgHMYMNcLHLKUU+3xoTMekZK793cniHI=; b=MeZZf67YCdZgB35UZSpCVCk6Lf+XL3zUV/10I4eNOdG12NtDLN9MSCqLDc7XpGTnuo SgMu2mY7Z5QKmELLVCT581BK57wPWurAsBsG4eABgNJnmOUbQ9Ce6pZRTs68xnAnjL6A ECRLkOH26GcgA9iziE2IXxlZmy32IWWjtMPq111YbEP/e8irhPHM0LzXye2iHqW62Gi4 uqMeXniw3fTdCRctXDUu5jB94iWr1s9ntI/LG8NlbZ0ur1/dnrGU5vwGPGpaj6PcDwgb sg69o7TYcAUbHK9hqkgSMkBThFnsMZxr/zu8PW4By/UPH4CknfTsbN0tInsLfIGlZIuI M/Yg== X-Gm-Message-State: AElRT7FTYn8GVbdOLQVg1Zk7yXjcR6tZ2FZ/Q/hegfnrg6jMj2u20lTs XBERPXJY/iY/GiD9idKDu3y3COs= X-Google-Smtp-Source: AG47ELvUuNg59NYdvZsAriiyRu621WlmfZkpzcScseH8Zfjp4Vqcp2o03U3BV7BOrnW2T3xEzBizqQ== X-Received: by 10.28.128.79 with SMTP id b76mr2052753wmd.10.1520978065577; Tue, 13 Mar 2018 14:54:25 -0700 (PDT) Received: from localhost.localdomain (2E6B52AC.dsl.pool.telekom.hu. [46.107.82.172]) by smtp.gmail.com with ESMTPSA id x17sm1379103wrg.32.2018.03.13.14.54.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 14:54:24 -0700 (PDT) From: =?UTF-8?Q?G=C3=A1bor?= Boskovits Date: Tue, 13 Mar 2018 22:54:16 +0100 Message-Id: <20180313215416.27638-1-boskovits@gmail.com> X-Mailer: git-send-email 2.16.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) * gnu/packages/patches/java-jeromq-fix-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/java.scm (java-jeromq)[source](patches): Add it. [arguments](#test-exclude): Disable more failing tests. --- gnu/local.mk | 1 + gnu/packages/java.scm | 11 +- gnu/packages/patches/java-jeromq-fix-tests.patch | 253 +++++++++++++++++++++++ 3 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/java-jeromq-fix-tests.patch diff --git a/gnu/local.mk b/gnu/local.mk index 9684d949f..2bae3660c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -782,6 +782,7 @@ dist_patch_DATA = \ %D%/packages/patches/intltool-perl-compatibility.patch \ %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ %D%/packages/patches/jacal-fix-texinfo.patch \ + %D%/packages/patches/java-jeromq-fix-tests.patch \ %D%/packages/patches/java-powermock-fix-java-files.patch \ %D%/packages/patches/java-xerces-bootclasspath.patch \ %D%/packages/patches/java-xerces-build_dont_unzip.patch \ diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 0f8c04e8b..85a8c9b3a 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -8117,7 +8117,8 @@ protocol-independent framework to build mail and messaging applications.") (file-name (string-append name "-" version "-checkout")) (sha256 (base32 - "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj")))) + "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj")) + (patches (search-patches "java-jeromq-fix-tests.patch")))) (build-system ant-build-system) (arguments `(#:jar-name "java-jeromq.jar" @@ -8131,7 +8132,13 @@ protocol-independent framework to build mail and messaging applications.") ;; Failures "**/DealerSpecTest.java" "**/CustomDecoderTest.java" - "**/CustomEncoderTest.java"))) + "**/CustomEncoderTest.java" + "**/ConnectRidTest.java" + "**/ReqSpecTest.java" + "**/PushPullSpecTest.java" + "**/PubSubHwmTest.java" + "**/RouterSpecTest.java" + "**/ProxyTest.java"))) (inputs `(("java-jnacl" ,java-jnacl))) (native-inputs diff --git a/gnu/packages/patches/java-jeromq-fix-tests.patch b/gnu/packages/patches/java-jeromq-fix-tests.patch new file mode 100644 index 000000000..5466b9270 --- /dev/null +++ b/gnu/packages/patches/java-jeromq-fix-tests.patch @@ -0,0 +1,253 @@ +From 5803aadd3f209eba1ffbb2cf7bf16778019dbee1 Mon Sep 17 00:00:00 2001 +From: fredoboulo +Date: Fri, 23 Feb 2018 23:55:57 +0100 +Subject: [PATCH] Fix #524 : V1 and V2 protocol downgrades handle received data + in handshake buffer + +This patch is upstream pull request, see: +https://gihub.com/zeromq/jeromq/pull/527. + +It is merged on commit c2afa9c, and we can drop it on the +0.4.4 release. + +--- + src/main/java/zmq/io/StreamEngine.java | 21 ++++++++++-- + src/test/java/zmq/io/AbstractProtocolVersion.java | 41 +++++++++++++---------- + src/test/java/zmq/io/V0ProtocolTest.java | 12 +++++++ + src/test/java/zmq/io/V1ProtocolTest.java | 16 +++++++-- + src/test/java/zmq/io/V2ProtocolTest.java | 16 +++++++-- + 5 files changed, 81 insertions(+), 25 deletions(-) + +diff --git a/src/main/java/zmq/io/StreamEngine.java b/src/main/java/zmq/io/StreamEngine.java +index b8933c92..fe2f2d8d 100644 +--- a/src/main/java/zmq/io/StreamEngine.java ++++ b/src/main/java/zmq/io/StreamEngine.java +@@ -816,9 +816,7 @@ private boolean handshake() + assert (bufferSize == headerSize); + + // Make sure the decoder sees the data we have already received. +- greetingRecv.flip(); +- inpos = greetingRecv; +- insize = greetingRecv.limit(); ++ decodeDataAfterHandshake(0); + + // To allow for interoperability with peers that do not forward + // their subscriptions, we inject a phantom subscription message +@@ -846,6 +844,8 @@ else if (greetingRecv.get(revisionPos) == Protocol.V1.revision) { + } + encoder = new V1Encoder(errno, Config.OUT_BATCH_SIZE.getValue()); + decoder = new V1Decoder(errno, Config.IN_BATCH_SIZE.getValue(), options.maxMsgSize, options.allocator); ++ ++ decodeDataAfterHandshake(V2_GREETING_SIZE); + } + else if (greetingRecv.get(revisionPos) == Protocol.V2.revision) { + // ZMTP/2.0 framing. +@@ -859,6 +859,8 @@ else if (greetingRecv.get(revisionPos) == Protocol.V2.revision) { + } + encoder = new V2Encoder(errno, Config.OUT_BATCH_SIZE.getValue()); + decoder = new V2Decoder(errno, Config.IN_BATCH_SIZE.getValue(), options.maxMsgSize, options.allocator); ++ ++ decodeDataAfterHandshake(V2_GREETING_SIZE); + } + else { + zmtpVersion = Protocol.V3; +@@ -904,6 +906,19 @@ else if (greetingRecv.get(revisionPos) == Protocol.V2.revision) { + return true; + } + ++ private void decodeDataAfterHandshake(int greetingSize) ++ { ++ final int pos = greetingRecv.position(); ++ if (pos > greetingSize) { ++ // data is present after handshake ++ greetingRecv.position(greetingSize).limit(pos); ++ ++ // Make sure the decoder sees this extra data. ++ inpos = greetingRecv; ++ insize = greetingRecv.remaining(); ++ } ++ } ++ + private Msg identityMsg() + { + Msg msg = new Msg(options.identitySize); +diff --git a/src/test/java/zmq/io/AbstractProtocolVersion.java b/src/test/java/zmq/io/AbstractProtocolVersion.java +index e60db403..aa06b4a7 100644 +--- a/src/test/java/zmq/io/AbstractProtocolVersion.java ++++ b/src/test/java/zmq/io/AbstractProtocolVersion.java +@@ -18,15 +18,18 @@ + import zmq.SocketBase; + import zmq.ZError; + import zmq.ZMQ; ++import zmq.ZMQ.Event; + import zmq.util.Utils; + + public abstract class AbstractProtocolVersion + { ++ protected static final int REPETITIONS = 1000; ++ + static class SocketMonitor extends Thread + { +- private final Ctx ctx; +- private final String monitorAddr; +- private final List events = new ArrayList<>(); ++ private final Ctx ctx; ++ private final String monitorAddr; ++ private final ZMQ.Event[] events = new ZMQ.Event[1]; + + public SocketMonitor(Ctx ctx, String monitorAddr) + { +@@ -41,15 +44,15 @@ public void run() + boolean rc = s.connect(monitorAddr); + assertThat(rc, is(true)); + // Only some of the exceptional events could fire +- while (true) { +- ZMQ.Event event = ZMQ.Event.read(s); +- if (event == null && s.errno() == ZError.ETERM) { +- break; +- } +- assertThat(event, notNullValue()); +- +- events.add(event); ++ ++ ZMQ.Event event = ZMQ.Event.read(s); ++ if (event == null && s.errno() == ZError.ETERM) { ++ s.close(); ++ return; + } ++ assertThat(event, notNullValue()); ++ ++ events[0] = event; + s.close(); + } + } +@@ -69,11 +72,12 @@ public void run() + boolean rc = ZMQ.setSocketOption(receiver, ZMQ.ZMQ_LINGER, 0); + assertThat(rc, is(true)); + +- SocketMonitor monitor = new SocketMonitor(ctx, "inproc://monitor"); +- monitor.start(); + rc = ZMQ.monitorSocket(receiver, "inproc://monitor", ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL); + assertThat(rc, is(true)); + ++ SocketMonitor monitor = new SocketMonitor(ctx, "inproc://monitor"); ++ monitor.start(); ++ + rc = ZMQ.bind(receiver, host); + assertThat(rc, is(true)); + +@@ -81,17 +85,18 @@ public void run() + OutputStream out = sender.getOutputStream(); + for (ByteBuffer raw : raws) { + out.write(raw.array()); +- ZMQ.msleep(100); + } + + Msg msg = ZMQ.recv(receiver, 0); + assertThat(msg, notNullValue()); + assertThat(new String(msg.data(), ZMQ.CHARSET), is(payload)); + +- ZMQ.msleep(500); +- assertThat(monitor.events.size(), is(1)); +- assertThat(monitor.events.get(0).event, is(ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL)); +- assertThat((Integer) monitor.events.get(0).arg, is(version)); ++ monitor.join(); ++ ++ final Event event = monitor.events[0]; ++ assertThat(event, notNullValue()); ++ assertThat(event.event, is(ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL)); ++ assertThat((Integer) event.arg, is(version)); + + InputStream in = sender.getInputStream(); + byte[] data = new byte[255]; +diff --git a/src/test/java/zmq/io/V0ProtocolTest.java b/src/test/java/zmq/io/V0ProtocolTest.java +index bd547d23..1a5b7aef 100644 +--- a/src/test/java/zmq/io/V0ProtocolTest.java ++++ b/src/test/java/zmq/io/V0ProtocolTest.java +@@ -10,6 +10,18 @@ + + public class V0ProtocolTest extends AbstractProtocolVersion + { ++ @Test ++ public void testFixIssue524() throws IOException, InterruptedException ++ { ++ for (int idx = 0; idx < REPETITIONS; ++idx) { ++ if (idx % 100 == 0) { ++ System.out.print(idx + " "); ++ } ++ testProtocolVersion0short(); ++ } ++ System.out.println(); ++ } ++ + @Test(timeout = 2000) + public void testProtocolVersion0short() throws IOException, InterruptedException + { +diff --git a/src/test/java/zmq/io/V1ProtocolTest.java b/src/test/java/zmq/io/V1ProtocolTest.java +index e1045f34..764159d0 100644 +--- a/src/test/java/zmq/io/V1ProtocolTest.java ++++ b/src/test/java/zmq/io/V1ProtocolTest.java +@@ -10,7 +10,19 @@ + + public class V1ProtocolTest extends AbstractProtocolVersion + { +- @Test(timeout = 2000) ++ @Test ++ public void testFixIssue524() throws IOException, InterruptedException ++ { ++ for (int idx = 0; idx < REPETITIONS; ++idx) { ++ if (idx % 100 == 0) { ++ System.out.print(idx + " "); ++ } ++ testProtocolVersion1short(); ++ } ++ System.out.println(); ++ } ++ ++ @Test + public void testProtocolVersion1short() throws IOException, InterruptedException + { + List raws = raws(0); +@@ -25,7 +37,7 @@ public void testProtocolVersion1short() throws IOException, InterruptedException + assertProtocolVersion(1, raws, "abcdefg"); + } + +- @Test(timeout = 2000) ++ @Test + public void testProtocolVersion1long() throws IOException, InterruptedException + { + List raws = raws(0); +diff --git a/src/test/java/zmq/io/V2ProtocolTest.java b/src/test/java/zmq/io/V2ProtocolTest.java +index d5e64bce..7fda31bc 100644 +--- a/src/test/java/zmq/io/V2ProtocolTest.java ++++ b/src/test/java/zmq/io/V2ProtocolTest.java +@@ -21,7 +21,19 @@ protected ByteBuffer identity() + .put((byte) 0); + } + +- @Test(timeout = 2000) ++ @Test ++ public void testFixIssue524() throws IOException, InterruptedException ++ { ++ for (int idx = 0; idx < REPETITIONS; ++idx) { ++ if (idx % 100 == 0) { ++ System.out.print(idx + " "); ++ } ++ testProtocolVersion2short(); ++ } ++ System.out.println(); ++ } ++ ++ @Test + public void testProtocolVersion2short() throws IOException, InterruptedException + { + List raws = raws(1); +@@ -38,7 +50,7 @@ public void testProtocolVersion2short() throws IOException, InterruptedException + assertProtocolVersion(2, raws, "abcdefg"); + } + +- @Test(timeout = 2000) ++ @Test + public void testProtocolVersion2long() throws IOException, InterruptedException + { + List raws = raws(1); -- 2.16.2 From unknown Tue Sep 09 21:33:06 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: =?UTF-8?Q?G=C3=A1bor?= Boskovits Subject: bug#30810: closed (Re: [PATCH] gnu: java-jeromq: Fix tests.) Message-ID: References: <20180313215416.27638-1-boskovits@gmail.com> X-Gnu-PR-Message: they-closed 30810 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 30810@debbugs.gnu.org Date: Tue, 13 Mar 2018 21:59:04 +0000 Content-Type: multipart/mixed; boundary="----------=_1520978344-8679-1" This is a multi-part message in MIME format... ------------=_1520978344-8679-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #30810: [PATCH] gnu: java-jeromq: Fix tests. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 30810@debbugs.gnu.org. --=20 30810: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30810 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1520978344-8679-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 30810-done) by debbugs.gnu.org; 13 Mar 2018 21:58:07 +0000 Received: from localhost ([127.0.0.1]:60094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evrvq-0002Ej-Fj for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:58:07 -0400 Received: from mail-it0-f51.google.com ([209.85.214.51]:38795) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evrvm-0002EB-FG for 30810-done@debbugs.gnu.org; Tue, 13 Mar 2018 17:58:05 -0400 Received: by mail-it0-f51.google.com with SMTP id j7-v6so2133358ita.3 for <30810-done@debbugs.gnu.org>; Tue, 13 Mar 2018 14:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hrPZBIYSethC6DTZbDj/OtaGR6269IcGoGRRdz2Kmvk=; b=NuBDao/9+97qDE6njcp697t/Sd+p/1RECFFKWkYexsgAH919yCi6/Wn99m7muxjPsk nnTEfXQwV9iCMahgiJgGwys4qK9CcLdwXVRIfF1DshaVI8LXiQnkQ2s48/XIO6+Cysmc O1FTw5RBUNk2hfLZvbKnh/2PvqP8wd1rl6JhvoTPOZfK1K0RHnl8AIz7Dasu60LpdhRd mJIsmRQjWftspOocwyHuIjDCuA0ig5eIg7Wv9p4eJw2ARZ5eCGjEpmt7EDCz7JighEPv 96E5k69IBP1jy5l9LaokowSLEZf6DogXE2wSrW63/4BK6WLMlVaoKWOWkRfL37quDhFc XXnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hrPZBIYSethC6DTZbDj/OtaGR6269IcGoGRRdz2Kmvk=; b=YfJa52wUTfTXdylTxkf3IQWh7nqoezocuP27z2C3NvkaUvcDlQyEyxODyib+roVwf2 +suZBTphfVAD8YdLRubiyQDwK/Y8udTN8iSx+XiikjrtT3lxGemy6i+ShwzD29OKTkhp mY9aYfWSSdtTjj5B+nAjsntQLCFy4Mwabckz1VvdV757Xrm1rqDFqq33X6YnNPohgs8D /ux05lOuXFlg/uW3gK9ZeqDkzVTdk2VabyNBK0rM6UTfRuUylI0u0nP7KQ9ajok4IS9n t2rU+WfFUq9KprJsnRoXs8sMZ9J7p+IDYnSfdCbprqUssLskBq9V7jKBVgnm6jLmoBAx 2sfw== X-Gm-Message-State: AElRT7G3SWOCl5G2TLlVtPW0nkLnOoli6wvAXI8tUUh4A7/oPhjTDyaG 3AXoJZVihKUk3soYtGmgLd0G4Smqi5GkMnTiqkcE X-Google-Smtp-Source: AG47ELtXUCzY2hJ0kfkGU5dX8KfoY4NmQH9CyoLQ4blUGs9VrpN5/fG/dB0D0YzcrMryJjK6l2pq2WA6PqdMM7BkHBM= X-Received: by 10.36.2.200 with SMTP id 191mr2742214itu.108.1520978276419; Tue, 13 Mar 2018 14:57:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.157.15 with HTTP; Tue, 13 Mar 2018 14:57:55 -0700 (PDT) In-Reply-To: <20180313215416.27638-1-boskovits@gmail.com> References: <20180313215416.27638-1-boskovits@gmail.com> From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Date: Tue, 13 Mar 2018 22:57:55 +0100 Message-ID: Subject: Re: [PATCH] gnu: java-jeromq: Fix tests. To: 30810-done@debbugs.gnu.org Content-Type: multipart/alternative; boundary="001a11446d98e0908a0567525953" X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 2018-03-13 22:54 GMT+01:00 Gábor Boskovits : > * gnu/packages/patches/java-jeromq-fix-tests.patch: New file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/java.scm (java-jeromq)[source](patches): Add it. > [arguments](#test-exclude): Disable more failing tests. > --- > gnu/local.mk | 1 + > gnu/packages/java.scm | 11 +- > gnu/packages/patches/java-jeromq-fix-tests.patch | 253 > +++++++++++++++++++++++ > 3 files changed, 263 insertions(+), 2 deletions(-) > create mode 100644 gnu/packages/patches/java-jeromq-fix-tests.patch > > diff --git a/gnu/local.mk b/gnu/local.mk > index 9684d949f..2bae3660c 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -782,6 +782,7 @@ dist_patch_DATA = > \ > %D%/packages/patches/intltool-perl-compatibility.patch \ > %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ > %D%/packages/patches/jacal-fix-texinfo.patch \ > + %D%/packages/patches/java-jeromq-fix-tests.patch \ > %D%/packages/patches/java-powermock-fix-java-files.patch \ > %D%/packages/patches/java-xerces-bootclasspath.patch \ > %D%/packages/patches/java-xerces-build_dont_unzip.patch \ > diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm > index 0f8c04e8b..85a8c9b3a 100644 > --- a/gnu/packages/java.scm > +++ b/gnu/packages/java.scm > @@ -8117,7 +8117,8 @@ protocol-independent framework to build mail and > messaging applications.") > (file-name (string-append name "-" version "-checkout")) > (sha256 > (base32 > - "1gxkp7lv2ahymgrqdw94ncq54bmp4 > m4sw5m1x9gkp7l5bxn0xsyj")))) > + "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj")) > + (patches (search-patches "java-jeromq-fix-tests.patch")))) > (build-system ant-build-system) > (arguments > `(#:jar-name "java-jeromq.jar" > @@ -8131,7 +8132,13 @@ protocol-independent framework to build mail and > messaging applications.") > ;; Failures > "**/DealerSpecTest.java" > "**/CustomDecoderTest.java" > - "**/CustomEncoderTest.java"))) > + "**/CustomEncoderTest.java" > + "**/ConnectRidTest.java" > + "**/ReqSpecTest.java" > + "**/PushPullSpecTest.java" > + "**/PubSubHwmTest.java" > + [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.214.51 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.214.51 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (boskovits[at]gmail.com) 0.0 HTML_MESSAGE BODY: HTML included in message 1.2 HTML_OBFUSCATE_10_20 BODY: Message is 10% to 20% HTML obfuscation -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: 30810-done Cc: =?UTF-8?Q?G=C3=A1bor_Boskovits?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 2018-03-13 22:54 GMT+01:00 Gábor Boskovits : > * gnu/packages/patches/java-jeromq-fix-tests.patch: New file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/java.scm (java-jeromq)[source](patches): Add it. > [arguments](#test-exclude): Disable more failing tests. > --- > gnu/local.mk | 1 + > gnu/packages/java.scm | 11 +- > gnu/packages/patches/java-jeromq-fix-tests.patch | 253 > +++++++++++++++++++++++ > 3 files changed, 263 insertions(+), 2 deletions(-) > create mode 100644 gnu/packages/patches/java-jeromq-fix-tests.patch > > diff --git a/gnu/local.mk b/gnu/local.mk > index 9684d949f..2bae3660c 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -782,6 +782,7 @@ dist_patch_DATA = > \ > %D%/packages/patches/intltool-perl-compatibility.patch \ > %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ > %D%/packages/patches/jacal-fix-texinfo.patch \ > + %D%/packages/patches/java-jeromq-fix-tests.patch \ > %D%/packages/patches/java-powermock-fix-java-files.patch \ > %D%/packages/patches/java-xerces-bootclasspath.patch \ > %D%/packages/patches/java-xerces-build_dont_unzip.patch \ > diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm > index 0f8c04e8b..85a8c9b3a 100644 > --- a/gnu/packages/java.scm > +++ b/gnu/packages/java.scm > @@ -8117,7 +8117,8 @@ protocol-independent framework to build mail and > messaging applications.") > (file-name (string-append name "-" version "-checkout")) > (sha256 > (base32 > - "1gxkp7lv2ahymgrqdw94ncq54bmp4 > m4sw5m1x9gkp7l5bxn0xsyj")))) > + "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj")) > + (patches (search-patches "java-jeromq-fix-tests.patch")))) > (build-system ant-build-system) > (arguments > `(#:jar-name "java-jeromq.jar" > @@ -8131,7 +8132,13 @@ protocol-independent framework to build mail and > messaging applications.") > ;; Failures > "**/DealerSpecTest.java" > "**/CustomDecoderTest.java" > - "**/CustomEncoderTest.java"))) > + "**/CustomEncoderTest.java" > + "**/ConnectRidTest.java" > + "**/ReqSpecTest.java" > + "**/PushPullSpecTest.java" > + "**/PubSubHwmTest.java" > + [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.214.51 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.214.51 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (boskovits[at]gmail.com) 0.0 HTML_MESSAGE BODY: HTML included in message 1.2 HTML_OBFUSCATE_10_20 BODY: Message is 10% to 20% HTML obfuscation -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid --001a11446d98e0908a0567525953 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 2018-03-13 22:54 GMT+01:00 G=C3=A1bor Boskovits : > * gnu/packages/patches/java-jeromq-fix-tests.patch: New file. > * gnu/local.mk (dist_patch_DATA): Add it. > * gnu/packages/java.scm (java-jeromq)[source](patches): Add it. > [arguments](#test-exclude): Disable more failing tests. > --- > gnu/local.mk | 1 + > gnu/packages/java.scm | 11 +- > gnu/packages/patches/java-jeromq-fix-tests.patch | 253 > +++++++++++++++++++++++ > 3 files changed, 263 insertions(+), 2 deletions(-) > create mode 100644 gnu/packages/patches/java-jeromq-fix-tests.patch > > diff --git a/gnu/local.mk b/gnu/local.mk > index 9684d949f..2bae3660c 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -782,6 +782,7 @@ dist_patch_DATA =3D > \ > %D%/packages/patches/intltool-perl-compatibility.patch \ > %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ > %D%/packages/patches/jacal-fix-texinfo.patch \ > + %D%/packages/patches/java-jeromq-fix-tests.patch \ > %D%/packages/patches/java-powermock-fix-java-files.patch \ > %D%/packages/patches/java-xerces-bootclasspath.patch \ > %D%/packages/patches/java-xerces-build_dont_unzip.patch \ > diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm > index 0f8c04e8b..85a8c9b3a 100644 > --- a/gnu/packages/java.scm > +++ b/gnu/packages/java.scm > @@ -8117,7 +8117,8 @@ protocol-independent framework to build mail and > messaging applications.") > (file-name (string-append name "-" version "-checkout")) > (sha256 > (base32 > - "1gxkp7lv2ahymgrqdw94ncq54bmp4 > m4sw5m1x9gkp7l5bxn0xsyj")))) > + "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj")) > + (patches (search-patches "java-jeromq-fix-tests.patch")))) > (build-system ant-build-system) > (arguments > `(#:jar-name "java-jeromq.jar" > @@ -8131,7 +8132,13 @@ protocol-independent framework to build mail and > messaging applications.") > ;; Failures > "**/DealerSpecTest.java" > "**/CustomDecoderTest.java" > - "**/CustomEncoderTest.java"))) > + "**/CustomEncoderTest.java" > + "**/ConnectRidTest.java" > + "**/ReqSpecTest.java" > + "**/PushPullSpecTest.java" > + "**/PubSubHwmTest.java" > + "**/RouterSpecTest.java" > + "**/ProxyTest.java"))) > (inputs > `(("java-jnacl" ,java-jnacl))) > (native-inputs > diff --git a/gnu/packages/patches/java-jeromq-fix-tests.patch > b/gnu/packages/patches/java-jeromq-fix-tests.patch > new file mode 100644 > index 000000000..5466b9270 > --- /dev/null > +++ b/gnu/packages/patches/java-jeromq-fix-tests.patch > @@ -0,0 +1,253 @@ > +From 5803aadd3f209eba1ffbb2cf7bf16778019dbee1 Mon Sep 17 00:00:00 2001 > +From: fredoboulo > +Date: Fri, 23 Feb 2018 23:55:57 +0100 > +Subject: [PATCH] Fix #524 : V1 and V2 protocol downgrades handle receive= d > data > + in handshake buffer > + > +This patch is upstream pull request, see: > +https://gihub.com/zeromq/jeromq/pull/527. > + > +It is merged on commit c2afa9c, and we can drop it on the > +0.4.4 release. > + > +--- > + src/main/java/zmq/io/StreamEngine.java | 21 ++++++++++-- > + src/test/java/zmq/io/AbstractProtocolVersion.java | 41 > +++++++++++++---------- > + src/test/java/zmq/io/V0ProtocolTest.java | 12 +++++++ > + src/test/java/zmq/io/V1ProtocolTest.java | 16 +++++++-- > + src/test/java/zmq/io/V2ProtocolTest.java | 16 +++++++-- > + 5 files changed, 81 insertions(+), 25 deletions(-) > + > +diff --git a/src/main/java/zmq/io/StreamEngine.java > b/src/main/java/zmq/io/StreamEngine.java > +index b8933c92..fe2f2d8d 100644 > +--- a/src/main/java/zmq/io/StreamEngine.java > ++++ b/src/main/java/zmq/io/StreamEngine.java > +@@ -816,9 +816,7 @@ private boolean handshake() > + assert (bufferSize =3D=3D headerSize); > + > + // Make sure the decoder sees the data we have already > received. > +- greetingRecv.flip(); > +- inpos =3D greetingRecv; > +- insize =3D greetingRecv.limit(); > ++ decodeDataAfterHandshake(0); > + > + // To allow for interoperability with peers that do not > forward > + // their subscriptions, we inject a phantom subscription > message > +@@ -846,6 +844,8 @@ else if (greetingRecv.get(revisionPos) =3D=3D > Protocol.V1.revision) { > + } > + encoder =3D new V1Encoder(errno, Config.OUT_BATCH_SIZE.getV= alue > ()); > + decoder =3D new V1Decoder(errno, Config.IN_BATCH_SIZE.getVa= lue(), > options.maxMsgSize, options.allocator); > ++ > ++ decodeDataAfterHandshake(V2_GREETING_SIZE); > + } > + else if (greetingRecv.get(revisionPos) =3D=3D Protocol.V2.revis= ion) { > + // ZMTP/2.0 framing. > +@@ -859,6 +859,8 @@ else if (greetingRecv.get(revisionPos) =3D=3D > Protocol.V2.revision) { > + } > + encoder =3D new V2Encoder(errno, Config.OUT_BATCH_SIZE.getV= alue > ()); > + decoder =3D new V2Decoder(errno, Config.IN_BATCH_SIZE.getVa= lue(), > options.maxMsgSize, options.allocator); > ++ > ++ decodeDataAfterHandshake(V2_GREETING_SIZE); > + } > + else { > + zmtpVersion =3D Protocol.V3; > +@@ -904,6 +906,19 @@ else if (greetingRecv.get(revisionPos) =3D=3D > Protocol.V2.revision) { > + return true; > + } > + > ++ private void decodeDataAfterHandshake(int greetingSize) > ++ { > ++ final int pos =3D greetingRecv.position(); > ++ if (pos > greetingSize) { > ++ // data is present after handshake > ++ greetingRecv.position(greetingSize).limit(pos); > ++ > ++ // Make sure the decoder sees this extra data. > ++ inpos =3D greetingRecv; > ++ insize =3D greetingRecv.remaining(); > ++ } > ++ } > ++ > + private Msg identityMsg() > + { > + Msg msg =3D new Msg(options.identitySize); > +diff --git a/src/test/java/zmq/io/AbstractProtocolVersion.java > b/src/test/java/zmq/io/AbstractProtocolVersion.java > +index e60db403..aa06b4a7 100644 > +--- a/src/test/java/zmq/io/AbstractProtocolVersion.java > ++++ b/src/test/java/zmq/io/AbstractProtocolVersion.java > +@@ -18,15 +18,18 @@ > + import zmq.SocketBase; > + import zmq.ZError; > + import zmq.ZMQ; > ++import zmq.ZMQ.Event; > + import zmq.util.Utils; > + > + public abstract class AbstractProtocolVersion > + { > ++ protected static final int REPETITIONS =3D 1000; > ++ > + static class SocketMonitor extends Thread > + { > +- private final Ctx ctx; > +- private final String monitorAddr; > +- private final List events =3D new ArrayList<>(); > ++ private final Ctx ctx; > ++ private final String monitorAddr; > ++ private final ZMQ.Event[] events =3D new ZMQ.Event[1]; > + > + public SocketMonitor(Ctx ctx, String monitorAddr) > + { > +@@ -41,15 +44,15 @@ public void run() > + boolean rc =3D s.connect(monitorAddr); > + assertThat(rc, is(true)); > + // Only some of the exceptional events could fire > +- while (true) { > +- ZMQ.Event event =3D ZMQ.Event.read(s); > +- if (event =3D=3D null && s.errno() =3D=3D ZError.ETERM)= { > +- break; > +- } > +- assertThat(event, notNullValue()); > +- > +- events.add(event); > ++ > ++ ZMQ.Event event =3D ZMQ.Event.read(s); > ++ if (event =3D=3D null && s.errno() =3D=3D ZError.ETERM) { > ++ s.close(); > ++ return; > + } > ++ assertThat(event, notNullValue()); > ++ > ++ events[0] =3D event; > + s.close(); > + } > + } > +@@ -69,11 +72,12 @@ public void run() > + boolean rc =3D ZMQ.setSocketOption(receiver, ZMQ.ZMQ_LINGER, 0)= ; > + assertThat(rc, is(true)); > + > +- SocketMonitor monitor =3D new SocketMonitor(ctx, > "inproc://monitor"); > +- monitor.start(); > + rc =3D ZMQ.monitorSocket(receiver, "inproc://monitor", > ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL); > + assertThat(rc, is(true)); > + > ++ SocketMonitor monitor =3D new SocketMonitor(ctx, > "inproc://monitor"); > ++ monitor.start(); > ++ > + rc =3D ZMQ.bind(receiver, host); > + assertThat(rc, is(true)); > + > +@@ -81,17 +85,18 @@ public void run() > + OutputStream out =3D sender.getOutputStream(); > + for (ByteBuffer raw : raws) { > + out.write(raw.array()); > +- ZMQ.msleep(100); > + } > + > + Msg msg =3D ZMQ.recv(receiver, 0); > + assertThat(msg, notNullValue()); > + assertThat(new String(msg.data(), ZMQ.CHARSET), is(payload)); > + > +- ZMQ.msleep(500); > +- assertThat(monitor.events.size(), is(1)); > +- assertThat(monitor.events.get(0).event, > is(ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL)); > +- assertThat((Integer) monitor.events.get(0).arg, is(version)); > ++ monitor.join(); > ++ > ++ final Event event =3D monitor.events[0]; > ++ assertThat(event, notNullValue()); > ++ assertThat(event.event, is(ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL)); > ++ assertThat((Integer) event.arg, is(version)); > + > + InputStream in =3D sender.getInputStream(); > + byte[] data =3D new byte[255]; > +diff --git a/src/test/java/zmq/io/V0ProtocolTest.java > b/src/test/java/zmq/io/V0ProtocolTest.java > +index bd547d23..1a5b7aef 100644 > +--- a/src/test/java/zmq/io/V0ProtocolTest.java > ++++ b/src/test/java/zmq/io/V0ProtocolTest.java > +@@ -10,6 +10,18 @@ > + > + public class V0ProtocolTest extends AbstractProtocolVersion > + { > ++ @Test > ++ public void testFixIssue524() throws IOException, > InterruptedException > ++ { > ++ for (int idx =3D 0; idx < REPETITIONS; ++idx) { > ++ if (idx % 100 =3D=3D 0) { > ++ System.out.print(idx + " "); > ++ } > ++ testProtocolVersion0short(); > ++ } > ++ System.out.println(); > ++ } > ++ > + @Test(timeout =3D 2000) > + public void testProtocolVersion0short() throws IOException, > InterruptedException > + { > +diff --git a/src/test/java/zmq/io/V1ProtocolTest.java > b/src/test/java/zmq/io/V1ProtocolTest.java > +index e1045f34..764159d0 100644 > +--- a/src/test/java/zmq/io/V1ProtocolTest.java > ++++ b/src/test/java/zmq/io/V1ProtocolTest.java > +@@ -10,7 +10,19 @@ > + > + public class V1ProtocolTest extends AbstractProtocolVersion > + { > +- @Test(timeout =3D 2000) > ++ @Test > ++ public void testFixIssue524() throws IOException, > InterruptedException > ++ { > ++ for (int idx =3D 0; idx < REPETITIONS; ++idx) { > ++ if (idx % 100 =3D=3D 0) { > ++ System.out.print(idx + " "); > ++ } > ++ testProtocolVersion1short(); > ++ } > ++ System.out.println(); > ++ } > ++ > ++ @Test > + public void testProtocolVersion1short() throws IOException, > InterruptedException > + { > + List raws =3D raws(0); > +@@ -25,7 +37,7 @@ public void testProtocolVersion1short() throws > IOException, InterruptedException > + assertProtocolVersion(1, raws, "abcdefg"); > + } > + > +- @Test(timeout =3D 2000) > ++ @Test > + public void testProtocolVersion1long() throws IOException, > InterruptedException > + { > + List raws =3D raws(0); > +diff --git a/src/test/java/zmq/io/V2ProtocolTest.java > b/src/test/java/zmq/io/V2ProtocolTest.java > +index d5e64bce..7fda31bc 100644 > +--- a/src/test/java/zmq/io/V2ProtocolTest.java > ++++ b/src/test/java/zmq/io/V2ProtocolTest.java > +@@ -21,7 +21,19 @@ protected ByteBuffer identity() > + .put((byte) 0); > + } > + > +- @Test(timeout =3D 2000) > ++ @Test > ++ public void testFixIssue524() throws IOException, > InterruptedException > ++ { > ++ for (int idx =3D 0; idx < REPETITIONS; ++idx) { > ++ if (idx % 100 =3D=3D 0) { > ++ System.out.print(idx + " "); > ++ } > ++ testProtocolVersion2short(); > ++ } > ++ System.out.println(); > ++ } > ++ > ++ @Test > + public void testProtocolVersion2short() throws IOException, > InterruptedException > + { > + List raws =3D raws(1); > +@@ -38,7 +50,7 @@ public void testProtocolVersion2short() throws > IOException, InterruptedException > + assertProtocolVersion(2, raws, "abcdefg"); > + } > + > +- @Test(timeout =3D 2000) > ++ @Test > + public void testProtocolVersion2long() throws IOException, > InterruptedException > + { > + List raws =3D raws(1); > -- > 2.16.2 > > Sorry, sent the wrong patch. --001a11446d98e0908a0567525953 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


2018-03-13 22:54 GMT+01:00 G=C3=A1bor Boskovits <<= a href=3D"mailto:boskovits@gmail.com" target=3D"_blank">boskovits@gmail.com= >:
* gnu/packages/patches/j= ava-jeromq-fix-tests.patch: New file.
* gnu/loca= l.mk (dist_patch_DATA): Add it.
* gnu/packages/java.scm (java-jeromq)[source](patches): Add it.
[arguments](#test-exclude): Disable more failing tests.
---
=C2=A0gnu/= local.mk=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2= =A0 =C2=A01 +
=C2=A0gnu/packages/java.scm=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 11 +-
=C2=A0gnu/packages/patches/java-jeromq-fix-tests.patch | 253 +++++++++= ++++++++++++++
=C2=A03 files changed, 263 insertions(+), 2 deletions(-)
=C2=A0create mode 100644 gnu/packages/patches/java-jeromq-fix-tests.pa= tch

diff --git a/gnu/local.mk b/gnu/local.mk
index 9684d949f..2bae3660c 100644
--- a/gnu/= local.mk
+++ b/gnu/= local.mk
@@ -782,6 +782,7 @@ dist_patch_DATA =3D=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
=C2=A0 =C2=A0%D%/packages/patches/intltool-perl-compatibility.pat= ch=C2=A0 =C2=A0 =C2=A0 =C2=A0\
=C2=A0 =C2=A0%D%/packages/patches/isl-0.11.1-aarch64-support.patch=C2= =A0 =C2=A0 =C2=A0 =C2=A0 \
=C2=A0 =C2=A0%D%/packages/patches/jacal-fix-texinfo.patch=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
+=C2=A0 %D%/packages/patches/java-jeromq-fix-tests.patch=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
=C2=A0 =C2=A0%D%/packages/patches/java-powermock-fix-java-files.patch= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\
=C2=A0 =C2=A0%D%/packages/patches/java-xerces-bootclasspath.patch \ =C2=A0 =C2=A0%D%/packages/patches/java-xerces-build_dont_unzip.patch= =C2=A0 =C2=A0 =C2=A0 \
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 0f8c04e8b..85a8c9b3a 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -8117,7 +8117,8 @@ protocol-independent framework to build mail and mess= aging applications.")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file-name (string-a= ppend name "-" version "-checkout"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(sha256
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (base32
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "1gxkp7lv2ahy= mgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "1gxkp7lv2ahy= mgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj"))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (patches (search-patches = "java-jeromq-fix-tests.patch"))))
=C2=A0 =C2=A0 =C2=A0(build-system ant-build-system)
=C2=A0 =C2=A0 =C2=A0(arguments
=C2=A0 =C2=A0 =C2=A0 `(#:jar-name "java-jeromq.jar"
@@ -8131,7 +8132,13 @@ protocol-independent framework to build mail and mes= saging applications.")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; Failures
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "**/DealerSpecTest.java"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "**/CustomDecoderTest.java" -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"**/CustomEncoderTest.java"))<= wbr>)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"**/CustomEncoderTest.java" +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"**/ConnectRidTest.java"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"**/ReqSpecTest.java"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"**/PushPullSpecTest.java"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"**/PubSubHwmTest.java"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"**/RouterSpecTest.java"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"**/ProxyTest.java")))
=C2=A0 =C2=A0 =C2=A0(inputs
=C2=A0 =C2=A0 =C2=A0 `(("java-jnacl" ,java-jnacl)))
=C2=A0 =C2=A0 =C2=A0(native-inputs
diff --git a/gnu/packages/patches/java-jeromq-fix-tests.patch b/gnu/pa= ckages/patches/java-jeromq-fix-tests.patch
new file mode 100644
index 000000000..5466b9270
--- /dev/null
+++ b/gnu/packages/patches/java-jeromq-fix-tests.patch
@@ -0,0 +1,253 @@
+From 5803aadd3f209eba1ffbb2cf7bf16778019dbee1 Mon Sep 17 00:00:00 200= 1
+From: fredoboulo <fredoboulo@users.noreply.github.com>
+Date: Fri, 23 Feb 2018 23:55:57 +0100
+Subject: [PATCH] Fix #524 : V1 and V2 protocol downgrades handle received = data
+ in handshake buffer
+
+This patch is upstream pull request, see:
+https://gihub.com/zeromq/jeromq/pull/527.
+
+It is merged on commit c2afa9c, and we can drop it on the
+0.4.4 release.
+
+---
+ src/main/java/zmq/io/StreamEngine.java=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 | 21 ++++++++++--
+ src/test/java/zmq/io/AbstractProtocolVersion.java | 41 +++++++++++++= ----------
+ src/test/java/zmq/io/V0ProtocolTest.java=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | 12 +++++++
+ src/test/java/zmq/io/V1ProtocolTest.java=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | 16 +++++++--
+ src/test/java/zmq/io/V2ProtocolTest.java=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | 16 +++++++--
+ 5 files changed, 81 insertions(+), 25 deletions(-)
+
+diff --git a/src/main/java/zmq/io/StreamEngine.java b/src/main/java/z= mq/io/StreamEngine.java
+index b8933c92..fe2f2d8d 100644
+--- a/src/main/java/zmq/io/StreamEngine.java
++++ b/src/main/java/zmq/io/StreamEngine.java
+@@ -816,9 +816,7 @@ private boolean handshake()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assert (bufferSize =3D=3D = headerSize);
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0//=C2=A0 Make sure the dec= oder sees the data we have already received.
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 greetingRecv.flip();
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 inpos =3D greetingRecv;
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 insize =3D greetingRecv.limit()= ;
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 decodeDataAfterHandshake(0); +
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0//=C2=A0 To allow for inte= roperability with peers that do not forward
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0//=C2=A0 their subscriptio= ns, we inject a phantom subscription message
+@@ -846,6 +844,8 @@ else if (greetingRecv.get(revisionPos) =3D=3D Protocol= .V1.revision) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0encoder =3D new V1Encoder(= errno, Config.OUT_BATCH_SIZE.getValue());
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0decoder =3D new V1Decoder(= errno, Config.IN_BATCH_SIZE.getValue(), options.maxMsgSize, options.al= locator);
++
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 decodeDataAfterHandshake(V2_GR<= wbr>EETING_SIZE);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else if (greetingRecv.get(revisionPos) = =3D=3D Protocol.V2.revision) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0//=C2=A0 ZMTP/2.0 framing.=
+@@ -859,6 +859,8 @@ else if (greetingRecv.get(revisionPos) =3D=3D Protocol= .V2.revision) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0encoder =3D new V2Encoder(= errno, Config.OUT_BATCH_SIZE.getValue());
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0decoder =3D new V2Decoder(= errno, Config.IN_BATCH_SIZE.getValue(), options.maxMsgSize, options.al= locator);
++
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 decodeDataAfterHandshake(V2_GR<= wbr>EETING_SIZE);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0zmtpVersion =3D Protocol.V= 3;
+@@ -904,6 +906,19 @@ else if (greetingRecv.get(revisionPos) =3D=3D Protoco= l.V2.revision) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return true;
+=C2=A0 =C2=A0 =C2=A0}
+
++=C2=A0 =C2=A0 private void decodeDataAfterHandshake(int greetingSize)
++=C2=A0 =C2=A0 {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 final int pos =3D greetingRecv.position(); ++=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (pos > greetingSize) {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // data is present after handsh= ake
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 greetingRecv.position(greeting<= wbr>Size).limit(pos);
++
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 //=C2=A0 Make sure the decoder = sees this extra data.
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 inpos =3D greetingRecv;
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 insize =3D greetingRecv.remaini= ng();
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
++=C2=A0 =C2=A0 }
++
+=C2=A0 =C2=A0 =C2=A0private Msg identityMsg()
+=C2=A0 =C2=A0 =C2=A0{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Msg msg =3D new Msg(options.identitySize= );
+diff --git a/src/test/java/zmq/io/AbstractProtocolVersion.java b/src/= test/java/zmq/io/AbstractProtocolVersion.java
+index e60db403..aa06b4a7 100644
+--- a/src/test/java/zmq/io/AbstractProtocolVersion.java
++++ b/src/test/java/zmq/io/AbstractProtocolVersion.java
+@@ -18,15 +18,18 @@
+ import zmq.SocketBase;
+ import zmq.ZError;
+ import zmq.ZMQ;
++import zmq.ZMQ.Event;
+ import zmq.util.Utils;
+
+ public abstract class AbstractProtocolVersion
+ {
++=C2=A0 =C2=A0 protected static final int REPETITIONS =3D 1000;
++
+=C2=A0 =C2=A0 =C2=A0static class SocketMonitor extends Thread
+=C2=A0 =C2=A0 =C2=A0{
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 private final Ctx=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0ctx;
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 private final String=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 monitorAddr;
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 private final List<ZMQ.Event> events = =3D new ArrayList<>();
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 private final Ctx=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0ctx;
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 private final String=C2=A0 =C2=A0 =C2=A0 moni= torAddr;
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 private final ZMQ.Event[] events =3D new ZMQ.= Event[1];
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0public SocketMonitor(Ctx ctx, String mon= itorAddr)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0{
+@@ -41,15 +44,15 @@ public void run()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0boolean rc =3D s.connect(m= onitorAddr);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assertThat(rc, is(true));<= br> +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0// Only some of the except= ional events could fire
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 while (true) {
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ZMQ.Event event = =3D ZMQ.Event.read(s);
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (event =3D=3D = null && s.errno() =3D=3D ZError.ETERM) {
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bre= ak;
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat(event,= notNullValue());
+-
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 events.add(event)= ;
++
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ZMQ.Event event =3D ZMQ.Event.r= ead(s);
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (event =3D=3D null &&= ; s.errno() =3D=3D ZError.ETERM) {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 s.close();
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat(event, notNullValue(= ));
++
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 events[0] =3D event;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0s.close();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 =C2=A0}
+@@ -69,11 +72,12 @@ public void run()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0boolean rc =3D ZMQ.setSocketOption(recei= ver, ZMQ.ZMQ_LINGER, 0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assertThat(rc, is(true));
+
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 SocketMonitor monitor =3D new SocketMonitor(c= tx, "inproc://monitor");
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor.start();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rc =3D ZMQ.monitorSocket(receiver, "= ;inproc://monitor", ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assertThat(rc, is(true));
+
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 SocketMonitor monitor =3D new SocketMonitor(c= tx, "inproc://monitor");
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor.start();
++
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0rc =3D ZMQ.bind(receiver, host);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assertThat(rc, is(true));
+
+@@ -81,17 +85,18 @@ public void run()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0OutputStream out =3D sender.getOutputStr= eam();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0for (ByteBuffer raw : raws) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0out.write(raw.array()); +-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ZMQ.msleep(100);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0}
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Msg msg =3D ZMQ.recv(receiver, 0);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assertThat(msg, notNullValue());
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assertThat(new String(msg.data(), ZMQ.CH= ARSET), is(payload));
+
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 ZMQ.msleep(500);
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat(monitor.events.size(), is(1))= ;
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat(monitor.events.get(0).event, = is(ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL));
+-=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat((Integer) monitor.events.get(0).ar= g, is(version));
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 monitor.join();
++
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 final Event event =3D monitor.events[0];
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat(event, notNullValue());
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat(event.event, is(ZMQ.ZMQ_EVENT_HAND= SHAKE_PROTOCOL));
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 assertThat((Integer) event.arg, is(version));=
+
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0InputStream in =3D sender.getInputStream= ();
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0byte[] data =3D new byte[255];
+diff --git a/src/test/java/zmq/io/V0ProtocolTest.java b/src/test/java= /zmq/io/V0ProtocolTest.java
+index bd547d23..1a5b7aef 100644
+--- a/src/test/java/zmq/io/V0ProtocolTest.java
++++ b/src/test/java/zmq/io/V0ProtocolTest.java
+@@ -10,6 +10,18 @@
+
+ public class V0ProtocolTest extends AbstractProtocolVersion
+ {
++=C2=A0 =C2=A0 @Test
++=C2=A0 =C2=A0 public void testFixIssue524() throws IOException, Interrupt= edException
++=C2=A0 =C2=A0 {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 for (int idx =3D 0; idx < REPETITIONS; ++i= dx) {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (idx % 100 =3D=3D 0) {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 System.out.print(= idx + " ");
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 testProtocolVersion0short(); ++=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 System.out.println();
++=C2=A0 =C2=A0 }
++
+=C2=A0 =C2=A0 =C2=A0@Test(timeout =3D 2000)
+=C2=A0 =C2=A0 =C2=A0public void testProtocolVersion0short() throws IOExcep= tion, InterruptedException
+=C2=A0 =C2=A0 =C2=A0{
+diff --git a/src/test/java/zmq/io/V1ProtocolTest.java b/src/test/java= /zmq/io/V1ProtocolTest.java
+index e1045f34..764159d0 100644
+--- a/src/test/java/zmq/io/V1ProtocolTest.java
++++ b/src/test/java/zmq/io/V1ProtocolTest.java
+@@ -10,7 +10,19 @@
+
+ public class V1ProtocolTest extends AbstractProtocolVersion
+ {
+-=C2=A0 =C2=A0 @Test(timeout =3D 2000)
++=C2=A0 =C2=A0 @Test
++=C2=A0 =C2=A0 public void testFixIssue524() throws IOException, Interrupt= edException
++=C2=A0 =C2=A0 {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 for (int idx =3D 0; idx < REPETITIONS; ++i= dx) {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (idx % 100 =3D=3D 0) {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 System.out.print(= idx + " ");
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 testProtocolVersion1short(); ++=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 System.out.println();
++=C2=A0 =C2=A0 }
++
++=C2=A0 =C2=A0 @Test
+=C2=A0 =C2=A0 =C2=A0public void testProtocolVersion1short() throws IOExcep= tion, InterruptedException
+=C2=A0 =C2=A0 =C2=A0{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0List<ByteBuffer> raws =3D raws(0);=
+@@ -25,7 +37,7 @@ public void testProtocolVersion1short() throws IOExcepti= on, InterruptedException
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assertProtocolVersion(1, raws, "abc= defg");
+=C2=A0 =C2=A0 =C2=A0}
+
+-=C2=A0 =C2=A0 @Test(timeout =3D 2000)
++=C2=A0 =C2=A0 @Test
+=C2=A0 =C2=A0 =C2=A0public void testProtocolVersion1long() throws IOExcept= ion, InterruptedException
+=C2=A0 =C2=A0 =C2=A0{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0List<ByteBuffer> raws =3D raws(0);=
+diff --git a/src/test/java/zmq/io/V2ProtocolTest.java b/src/test/java= /zmq/io/V2ProtocolTest.java
+index d5e64bce..7fda31bc 100644
+--- a/src/test/java/zmq/io/V2ProtocolTest.java
++++ b/src/test/java/zmq/io/V2ProtocolTest.java
+@@ -21,7 +21,19 @@ protected ByteBuffer identity()
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.put((byte) = 0);
+=C2=A0 =C2=A0 =C2=A0}
+
+-=C2=A0 =C2=A0 @Test(timeout =3D 2000)
++=C2=A0 =C2=A0 @Test
++=C2=A0 =C2=A0 public void testFixIssue524() throws IOException, Interrupt= edException
++=C2=A0 =C2=A0 {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 for (int idx =3D 0; idx < REPETITIONS; ++i= dx) {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (idx % 100 =3D=3D 0) {
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 System.out.print(= idx + " ");
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 testProtocolVersion2short(); ++=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
++=C2=A0 =C2=A0 =C2=A0 =C2=A0 System.out.println();
++=C2=A0 =C2=A0 }
++
++=C2=A0 =C2=A0 @Test
+=C2=A0 =C2=A0 =C2=A0public void testProtocolVersion2short() throws IOExcep= tion, InterruptedException
+=C2=A0 =C2=A0 =C2=A0{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0List<ByteBuffer> raws =3D raws(1);=
+@@ -38,7 +50,7 @@ public void testProtocolVersion2short() throws IOExcepti= on, InterruptedException
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assertProtocolVersion(2, raws, "abc= defg");
+=C2=A0 =C2=A0 =C2=A0}
+
+-=C2=A0 =C2=A0 @Test(timeout =3D 2000)
++=C2=A0 =C2=A0 @Test
+=C2=A0 =C2=A0 =C2=A0public void testProtocolVersion2long() throws IOExcept= ion, InterruptedException
+=C2=A0 =C2=A0 =C2=A0{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0List<ByteBuffer> raws =3D raws(1);=
--
2.16.2

Sorry, sent the wrong patch.
--001a11446d98e0908a0567525953-- ------------=_1520978344-8679-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Mar 2018 21:54:49 +0000 Received: from localhost ([127.0.0.1]:60079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evrsa-00028C-MJ for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:54:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1evrsX-00027x-7G for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:54:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evrsQ-0003DO-5X for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:54:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evrsQ-0003DK-1C for submit@debbugs.gnu.org; Tue, 13 Mar 2018 17:54:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evrsN-0003Su-SU for guix-patches@gnu.org; Tue, 13 Mar 2018 17:54:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evrsJ-0003BM-KG for guix-patches@gnu.org; Tue, 13 Mar 2018 17:54:31 -0400 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:36016) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1evrsJ-0003B2-9q for guix-patches@gnu.org; Tue, 13 Mar 2018 17:54:27 -0400 Received: by mail-wm0-x22f.google.com with SMTP id i194so691499wmg.1 for ; Tue, 13 Mar 2018 14:54:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/GiY/1NnjDcWgHMYMNcLHLKUU+3xoTMekZK793cniHI=; b=FO6Cfr32kOsm1zQ7Y1YGz2aFn2UNdaEXdJbz3ObjxxkzwgPGxk4TMjpok9/yAo+R4d /ewqIIwgZN9sbngoqLUBhX8FwvjUVCoEttzFcar+k37I81SPqjXg/5tnCdqdWZ7Di/Nx aLKS789wMIeuN6ayedgIJuMTWq6zcMwMZQBpMkZ2KVWvAXI0hasowOXNMoALlwbPlrqP WTYIDxIdroVWaHEn/PVut3LhrKkcfyzLbN3KuH3STmG5jpmFn7zJEYY7N6TIPFb1wOG9 5Xg3Fypt5pne7ZB3b9uVSp9Tok5msfcaVewsOkv8651iguS2zCV68qJ1Y0OF7r+VCeOJ S1vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/GiY/1NnjDcWgHMYMNcLHLKUU+3xoTMekZK793cniHI=; b=MeZZf67YCdZgB35UZSpCVCk6Lf+XL3zUV/10I4eNOdG12NtDLN9MSCqLDc7XpGTnuo SgMu2mY7Z5QKmELLVCT581BK57wPWurAsBsG4eABgNJnmOUbQ9Ce6pZRTs68xnAnjL6A ECRLkOH26GcgA9iziE2IXxlZmy32IWWjtMPq111YbEP/e8irhPHM0LzXye2iHqW62Gi4 uqMeXniw3fTdCRctXDUu5jB94iWr1s9ntI/LG8NlbZ0ur1/dnrGU5vwGPGpaj6PcDwgb sg69o7TYcAUbHK9hqkgSMkBThFnsMZxr/zu8PW4By/UPH4CknfTsbN0tInsLfIGlZIuI M/Yg== X-Gm-Message-State: AElRT7FTYn8GVbdOLQVg1Zk7yXjcR6tZ2FZ/Q/hegfnrg6jMj2u20lTs XBERPXJY/iY/GiD9idKDu3y3COs= X-Google-Smtp-Source: AG47ELvUuNg59NYdvZsAriiyRu621WlmfZkpzcScseH8Zfjp4Vqcp2o03U3BV7BOrnW2T3xEzBizqQ== X-Received: by 10.28.128.79 with SMTP id b76mr2052753wmd.10.1520978065577; Tue, 13 Mar 2018 14:54:25 -0700 (PDT) Received: from localhost.localdomain (2E6B52AC.dsl.pool.telekom.hu. [46.107.82.172]) by smtp.gmail.com with ESMTPSA id x17sm1379103wrg.32.2018.03.13.14.54.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Mar 2018 14:54:24 -0700 (PDT) From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= To: guix-patches@gnu.org Subject: [PATCH] gnu: java-jeromq: Fix tests. Date: Tue, 13 Mar 2018 22:54:16 +0100 Message-Id: <20180313215416.27638-1-boskovits@gmail.com> X-Mailer: git-send-email 2.16.2 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?G=C3=A1bor=20Boskovits?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) * gnu/packages/patches/java-jeromq-fix-tests.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/java.scm (java-jeromq)[source](patches): Add it. [arguments](#test-exclude): Disable more failing tests. --- gnu/local.mk | 1 + gnu/packages/java.scm | 11 +- gnu/packages/patches/java-jeromq-fix-tests.patch | 253 +++++++++++++++++++++++ 3 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/java-jeromq-fix-tests.patch diff --git a/gnu/local.mk b/gnu/local.mk index 9684d949f..2bae3660c 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -782,6 +782,7 @@ dist_patch_DATA = \ %D%/packages/patches/intltool-perl-compatibility.patch \ %D%/packages/patches/isl-0.11.1-aarch64-support.patch \ %D%/packages/patches/jacal-fix-texinfo.patch \ + %D%/packages/patches/java-jeromq-fix-tests.patch \ %D%/packages/patches/java-powermock-fix-java-files.patch \ %D%/packages/patches/java-xerces-bootclasspath.patch \ %D%/packages/patches/java-xerces-build_dont_unzip.patch \ diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 0f8c04e8b..85a8c9b3a 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -8117,7 +8117,8 @@ protocol-independent framework to build mail and messaging applications.") (file-name (string-append name "-" version "-checkout")) (sha256 (base32 - "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj")))) + "1gxkp7lv2ahymgrqdw94ncq54bmp4m4sw5m1x9gkp7l5bxn0xsyj")) + (patches (search-patches "java-jeromq-fix-tests.patch")))) (build-system ant-build-system) (arguments `(#:jar-name "java-jeromq.jar" @@ -8131,7 +8132,13 @@ protocol-independent framework to build mail and messaging applications.") ;; Failures "**/DealerSpecTest.java" "**/CustomDecoderTest.java" - "**/CustomEncoderTest.java"))) + "**/CustomEncoderTest.java" + "**/ConnectRidTest.java" + "**/ReqSpecTest.java" + "**/PushPullSpecTest.java" + "**/PubSubHwmTest.java" + "**/RouterSpecTest.java" + "**/ProxyTest.java"))) (inputs `(("java-jnacl" ,java-jnacl))) (native-inputs diff --git a/gnu/packages/patches/java-jeromq-fix-tests.patch b/gnu/packages/patches/java-jeromq-fix-tests.patch new file mode 100644 index 000000000..5466b9270 --- /dev/null +++ b/gnu/packages/patches/java-jeromq-fix-tests.patch @@ -0,0 +1,253 @@ +From 5803aadd3f209eba1ffbb2cf7bf16778019dbee1 Mon Sep 17 00:00:00 2001 +From: fredoboulo +Date: Fri, 23 Feb 2018 23:55:57 +0100 +Subject: [PATCH] Fix #524 : V1 and V2 protocol downgrades handle received data + in handshake buffer + +This patch is upstream pull request, see: +https://gihub.com/zeromq/jeromq/pull/527. + +It is merged on commit c2afa9c, and we can drop it on the +0.4.4 release. + +--- + src/main/java/zmq/io/StreamEngine.java | 21 ++++++++++-- + src/test/java/zmq/io/AbstractProtocolVersion.java | 41 +++++++++++++---------- + src/test/java/zmq/io/V0ProtocolTest.java | 12 +++++++ + src/test/java/zmq/io/V1ProtocolTest.java | 16 +++++++-- + src/test/java/zmq/io/V2ProtocolTest.java | 16 +++++++-- + 5 files changed, 81 insertions(+), 25 deletions(-) + +diff --git a/src/main/java/zmq/io/StreamEngine.java b/src/main/java/zmq/io/StreamEngine.java +index b8933c92..fe2f2d8d 100644 +--- a/src/main/java/zmq/io/StreamEngine.java ++++ b/src/main/java/zmq/io/StreamEngine.java +@@ -816,9 +816,7 @@ private boolean handshake() + assert (bufferSize == headerSize); + + // Make sure the decoder sees the data we have already received. +- greetingRecv.flip(); +- inpos = greetingRecv; +- insize = greetingRecv.limit(); ++ decodeDataAfterHandshake(0); + + // To allow for interoperability with peers that do not forward + // their subscriptions, we inject a phantom subscription message +@@ -846,6 +844,8 @@ else if (greetingRecv.get(revisionPos) == Protocol.V1.revision) { + } + encoder = new V1Encoder(errno, Config.OUT_BATCH_SIZE.getValue()); + decoder = new V1Decoder(errno, Config.IN_BATCH_SIZE.getValue(), options.maxMsgSize, options.allocator); ++ ++ decodeDataAfterHandshake(V2_GREETING_SIZE); + } + else if (greetingRecv.get(revisionPos) == Protocol.V2.revision) { + // ZMTP/2.0 framing. +@@ -859,6 +859,8 @@ else if (greetingRecv.get(revisionPos) == Protocol.V2.revision) { + } + encoder = new V2Encoder(errno, Config.OUT_BATCH_SIZE.getValue()); + decoder = new V2Decoder(errno, Config.IN_BATCH_SIZE.getValue(), options.maxMsgSize, options.allocator); ++ ++ decodeDataAfterHandshake(V2_GREETING_SIZE); + } + else { + zmtpVersion = Protocol.V3; +@@ -904,6 +906,19 @@ else if (greetingRecv.get(revisionPos) == Protocol.V2.revision) { + return true; + } + ++ private void decodeDataAfterHandshake(int greetingSize) ++ { ++ final int pos = greetingRecv.position(); ++ if (pos > greetingSize) { ++ // data is present after handshake ++ greetingRecv.position(greetingSize).limit(pos); ++ ++ // Make sure the decoder sees this extra data. ++ inpos = greetingRecv; ++ insize = greetingRecv.remaining(); ++ } ++ } ++ + private Msg identityMsg() + { + Msg msg = new Msg(options.identitySize); +diff --git a/src/test/java/zmq/io/AbstractProtocolVersion.java b/src/test/java/zmq/io/AbstractProtocolVersion.java +index e60db403..aa06b4a7 100644 +--- a/src/test/java/zmq/io/AbstractProtocolVersion.java ++++ b/src/test/java/zmq/io/AbstractProtocolVersion.java +@@ -18,15 +18,18 @@ + import zmq.SocketBase; + import zmq.ZError; + import zmq.ZMQ; ++import zmq.ZMQ.Event; + import zmq.util.Utils; + + public abstract class AbstractProtocolVersion + { ++ protected static final int REPETITIONS = 1000; ++ + static class SocketMonitor extends Thread + { +- private final Ctx ctx; +- private final String monitorAddr; +- private final List events = new ArrayList<>(); ++ private final Ctx ctx; ++ private final String monitorAddr; ++ private final ZMQ.Event[] events = new ZMQ.Event[1]; + + public SocketMonitor(Ctx ctx, String monitorAddr) + { +@@ -41,15 +44,15 @@ public void run() + boolean rc = s.connect(monitorAddr); + assertThat(rc, is(true)); + // Only some of the exceptional events could fire +- while (true) { +- ZMQ.Event event = ZMQ.Event.read(s); +- if (event == null && s.errno() == ZError.ETERM) { +- break; +- } +- assertThat(event, notNullValue()); +- +- events.add(event); ++ ++ ZMQ.Event event = ZMQ.Event.read(s); ++ if (event == null && s.errno() == ZError.ETERM) { ++ s.close(); ++ return; + } ++ assertThat(event, notNullValue()); ++ ++ events[0] = event; + s.close(); + } + } +@@ -69,11 +72,12 @@ public void run() + boolean rc = ZMQ.setSocketOption(receiver, ZMQ.ZMQ_LINGER, 0); + assertThat(rc, is(true)); + +- SocketMonitor monitor = new SocketMonitor(ctx, "inproc://monitor"); +- monitor.start(); + rc = ZMQ.monitorSocket(receiver, "inproc://monitor", ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL); + assertThat(rc, is(true)); + ++ SocketMonitor monitor = new SocketMonitor(ctx, "inproc://monitor"); ++ monitor.start(); ++ + rc = ZMQ.bind(receiver, host); + assertThat(rc, is(true)); + +@@ -81,17 +85,18 @@ public void run() + OutputStream out = sender.getOutputStream(); + for (ByteBuffer raw : raws) { + out.write(raw.array()); +- ZMQ.msleep(100); + } + + Msg msg = ZMQ.recv(receiver, 0); + assertThat(msg, notNullValue()); + assertThat(new String(msg.data(), ZMQ.CHARSET), is(payload)); + +- ZMQ.msleep(500); +- assertThat(monitor.events.size(), is(1)); +- assertThat(monitor.events.get(0).event, is(ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL)); +- assertThat((Integer) monitor.events.get(0).arg, is(version)); ++ monitor.join(); ++ ++ final Event event = monitor.events[0]; ++ assertThat(event, notNullValue()); ++ assertThat(event.event, is(ZMQ.ZMQ_EVENT_HANDSHAKE_PROTOCOL)); ++ assertThat((Integer) event.arg, is(version)); + + InputStream in = sender.getInputStream(); + byte[] data = new byte[255]; +diff --git a/src/test/java/zmq/io/V0ProtocolTest.java b/src/test/java/zmq/io/V0ProtocolTest.java +index bd547d23..1a5b7aef 100644 +--- a/src/test/java/zmq/io/V0ProtocolTest.java ++++ b/src/test/java/zmq/io/V0ProtocolTest.java +@@ -10,6 +10,18 @@ + + public class V0ProtocolTest extends AbstractProtocolVersion + { ++ @Test ++ public void testFixIssue524() throws IOException, InterruptedException ++ { ++ for (int idx = 0; idx < REPETITIONS; ++idx) { ++ if (idx % 100 == 0) { ++ System.out.print(idx + " "); ++ } ++ testProtocolVersion0short(); ++ } ++ System.out.println(); ++ } ++ + @Test(timeout = 2000) + public void testProtocolVersion0short() throws IOException, InterruptedException + { +diff --git a/src/test/java/zmq/io/V1ProtocolTest.java b/src/test/java/zmq/io/V1ProtocolTest.java +index e1045f34..764159d0 100644 +--- a/src/test/java/zmq/io/V1ProtocolTest.java ++++ b/src/test/java/zmq/io/V1ProtocolTest.java +@@ -10,7 +10,19 @@ + + public class V1ProtocolTest extends AbstractProtocolVersion + { +- @Test(timeout = 2000) ++ @Test ++ public void testFixIssue524() throws IOException, InterruptedException ++ { ++ for (int idx = 0; idx < REPETITIONS; ++idx) { ++ if (idx % 100 == 0) { ++ System.out.print(idx + " "); ++ } ++ testProtocolVersion1short(); ++ } ++ System.out.println(); ++ } ++ ++ @Test + public void testProtocolVersion1short() throws IOException, InterruptedException + { + List raws = raws(0); +@@ -25,7 +37,7 @@ public void testProtocolVersion1short() throws IOException, InterruptedException + assertProtocolVersion(1, raws, "abcdefg"); + } + +- @Test(timeout = 2000) ++ @Test + public void testProtocolVersion1long() throws IOException, InterruptedException + { + List raws = raws(0); +diff --git a/src/test/java/zmq/io/V2ProtocolTest.java b/src/test/java/zmq/io/V2ProtocolTest.java +index d5e64bce..7fda31bc 100644 +--- a/src/test/java/zmq/io/V2ProtocolTest.java ++++ b/src/test/java/zmq/io/V2ProtocolTest.java +@@ -21,7 +21,19 @@ protected ByteBuffer identity() + .put((byte) 0); + } + +- @Test(timeout = 2000) ++ @Test ++ public void testFixIssue524() throws IOException, InterruptedException ++ { ++ for (int idx = 0; idx < REPETITIONS; ++idx) { ++ if (idx % 100 == 0) { ++ System.out.print(idx + " "); ++ } ++ testProtocolVersion2short(); ++ } ++ System.out.println(); ++ } ++ ++ @Test + public void testProtocolVersion2short() throws IOException, InterruptedException + { + List raws = raws(1); +@@ -38,7 +50,7 @@ public void testProtocolVersion2short() throws IOException, InterruptedException + assertProtocolVersion(2, raws, "abcdefg"); + } + +- @Test(timeout = 2000) ++ @Test + public void testProtocolVersion2long() throws IOException, InterruptedException + { + List raws = raws(1); -- 2.16.2 ------------=_1520978344-8679-1--