From 5f6ff69f623307fc8900ad41a055ed07eaa1c9e7 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Mon, 7 Aug 2017 09:26:38 +0100 Subject: [PATCH] Problem: test_security_curve fails due to ECONNABORTED Solution: expect that error, which can happen on very slow machines due to a client timimng out or RST before the connection is accepted by the server --- tests/test_security_curve.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_security_curve.cpp b/tests/test_security_curve.cpp index ed18f4fc..79a43cce 100644 --- a/tests/test_security_curve.cpp +++ b/tests/test_security_curve.cpp @@ -311,8 +311,8 @@ void expect_new_client_curve_bounce_fail (void *ctx, // expects that one or more occurrences of the expected event are received // via the specified socket monitor // returns the number of occurrences of the expected event -// interrupts, if a ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL/EPIPE/ECONNRESET -// occurs; in this case, 0 is returned +// interrupts, if a ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL with EPIPE, ECONNRESET +// or ECONNABORTED occurs; in this case, 0 is returned // this should be investigated further, see // https://github.com/zeromq/libzmq/issues/2644 int expect_monitor_event_multiple (void *server_mon, @@ -330,11 +330,12 @@ int expect_monitor_event_multiple (void *server_mon, != -1) { timeout = 250; - // ignore errors with EPIPE/ECONNRESET, which happen sporadically + // ignore errors with EPIPE/ECONNRESET/ECONNABORTED, which can happen // ECONNRESET can happen on very slow machines, when the engine writes // to the peer and then tries to read the socket before the peer reads + // ECONNABORTED happens when a client aborts a connection via RST/timeout if (event == ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL && - (err == EPIPE || err == ECONNRESET)) { + (err == EPIPE || err == ECONNRESET || err == ECONNABORTED)) { fprintf (stderr, "Ignored event: %x (err = %i)\n", event, err); client_closed_connection = 1; break;