Commit Graph

732 Commits

Author SHA1 Message Date
Luca Boccassi
0298d037d0 Problem: CMake rebuilds everything twice
Solution: build all the objects separately before the link step, to
avoid rebuilding when doing both static and shared builds
2017-11-20 15:55:35 +00:00
Luca Boccassi
5264d49eab Problem: duplicate definition in CMake tweetnacl builds
Solution: don't redefine preprocessor macro if it's already defined in
platform.hpp
2017-11-19 12:47:05 +00:00
Luca Boccassi
de8f14adf5 Problem: test_security_{zap|curve} often hangs
Solution: set 0 linger on the sockets immediately after creating them
rather than immediately before closing them.
Running through helgrind/drd highlights a few race conditions, one of
which is the setting of linger vs checking it when closing the socket.
Work around it by setting it immediately to fix the test hangs.
2017-11-16 00:44:29 +00:00
Luca Boccassi
498c6bbb67 Problem: test_stream_exceeds_buffer cannot be ran in parallel
Solution: bind to wildcard and let the OS pick a free port instead
of using an hard-coded 12345 TCP port
2017-11-10 09:49:54 +00:00
Rolf Timmermans
c8592dfbc3 Problem: REQ socket with ZMQ_REQ_RELAXED does not report ZMQ_POLLOUT when queried for events after first message.
Solution: Check for strictness before returning false if no reply has been received.
2017-11-08 09:55:14 +01:00
f18m
2aa0e6fd4d Change ZMQ_THREAD_AFFINITY to ZMQ_THREAD_AFFINITY_CPU_ADD/ZMQ_THREAD_AFFINITY_CPU_REMOVE. Avoid prefix thread names when no prefix was set. 2017-10-25 09:55:47 +02:00
Luca Boccassi
bd2ff7fbf8 Problem: DRAFT build broken with old GCC due to missing SIZE_MAX
Solution: define __STDC_LIMIT_MACROS in test_timers.cpp before
including testutil.hpp so that the definitions are included
2017-10-17 14:13:28 +01:00
Luca Boccassi
2e2c22dd5b Problem: DRAFT build broken with old GCC due to GNU modifier
Solution: print unsigned integers instead of size_t to avoid the error:

  error: ISO C++ does not support the 'z' gnu_printf length modifier

due to very old version of GCC.
2017-10-17 13:36:10 +01:00
f18m
f25cd6e7be Background thread names (#2784)
* Add ZMQ_THREAD_NAME_PREFIX ctx option
2017-10-17 12:06:50 +01:00
Luca Boccassi
4c2a95eab2 Problem: test_ctx_options only checks global DRAFT flag
Solution: this will break once the tested APIs move from DRAFT to STABLE
so instead check for the specific macros.
2017-10-16 12:34:13 +01:00
f18m
bfbb4ff2e9 Background threads enhancements (#2778)
* Background thread scheduling 

- add ZMQ_THREAD_AFFINITY ctx option; set all thread scheduling options
from the context of the secondary thread instead of using the main
process thread context!
- change ZMQ_THREAD_PRIORITY to support setting NICE of the background
thread when using SCHED_OTHER
2017-10-16 12:29:03 +01:00
Luca Boccassi
b6aee51691 Problem: strict ZAP protocol adherence is backward incompatible
Solution: add ZMQ_ZAP_ENFORCE_DOMAIN to hide backward incompatible
change and make it disabled by default.
In a future release that breaks API compatibility we can then switch
the default to enabled in order to achieve full RFC compatibility.

Fixes #2762
2017-10-09 17:48:33 +01:00
Luca Boccassi
ed64585e93 Problem: test_rebind_ipc might not see race condition on fast envs
Solution: pre-create the second socket to save a few cycles between
closing the old one and binding the new one
2017-10-06 11:32:14 +01:00
Luca Boccassi
53f463a3fa Problem: test_rebind_ipc uses generic socket file name
Solution: name it after the test to avoid possible clashes when
running tests in parallel.
2017-10-06 11:08:40 +01:00
Ilya Kulakov
656cdb959a Problem: Race condition in IPC sockets
Solution: Don't unlink file on close

File may not belong to the socket at that point.
2017-10-05 14:57:10 -07:00
Luca Boccassi
44f96a3652 Merge pull request #2745 from sigiesec/rename-identity
Problem: term "identity" is confusing
2017-09-20 10:08:45 +02:00
Constantin Rack
f6688f0516 Merge pull request #2756 from bluca/reconnect_ivl_connect
Problem: zmq_connect fails after disconnect due to RECONNECT_IVL == -1
2017-09-20 07:46:19 +02:00
sigiesec
4b821d8f84 Problem: remaining uses of "identity"
Solution: replaced by "routing id"
2017-09-19 17:54:59 +02:00
sigiesec
1414bf938c Problem: use of unqualified "id" in code example
Solution: use "routing_id" instead
2017-09-19 17:54:52 +02:00
sigiesec
41bae55af7 Problem: inconsistent naming related to routing ids
Solution: renamed routing_id fields in pipe_t, renamed ZMQ_CONNECT_RID to ZMQ_CONNECT_ROUTING_ID
2017-09-19 17:53:53 +02:00
sigiesec
9e7507b38b Problem: term "identity" is confusing
Solution: replace by "routing id"
2017-09-19 17:53:44 +02:00
Luca Boccassi
edb4ca1023 Problem: zmq_connect fails after disconnect due to RECONNECT_IVL == -1
Solution: when a connection breaks and ZMQ_RECONNECT_IVL is set to -1,
which means a reconnection will not be attempted, send a message from
the I/O thread to the application thread to make the socket call
term_endpoint, which is the equivalent of manually calling
zmq_disconnect.
This way subsequent zmq_connect call to the same endpoint will attempt
again to do a connection.
Otherwise, for some socket types like SUBs, those new connects will
fail as the endpoint is recorded, despite the connection having been
permanently closed.

Add test cases to exercise this corner case with TCP and IPC.
2017-09-19 14:05:43 +01:00
sigiesec
e0243dcbca Problem: tests where client should receive an ERROR sometimes do not
receive an ERROR (probably because the connection is closed before)

Solution: wait for client-side monitor events before closing the client
socket

Fixes #2705
2017-09-19 11:16:05 +02:00
sigiesec
77f76a49b2 Problem: no tests for cases 5 and 6 of #2711
Solution: added tests
2017-09-18 18:43:32 +02:00
sigiesec
e546f9296e Problem: duplicated code & inconsistent behaviour between
mechanisms

Solution: uniformly require a ZAP domain to be set to activate ZAP
handling, clarify comment on Stonehouse pattern
2017-09-18 17:01:38 +02:00
sigiesec
ee8b8bd29c Problem: no test for ZAP handler terminating in flight
Solution: added test & some improvements of test utils
2017-09-18 16:54:03 +02:00
sigiesec
a5f94cb610 Problem: tests without ZAP handler are failing
Solution: emit events as expected by tests, and refuse connections when
ZAP is required but no handler started

Addresses #2711 partially
2017-09-18 12:58:09 +02:00
sigiesec
13b972b226 Problem: no tests without ZAP handler where one is expected
Solution: added test case for NULL/PLAIN/CURVE
2017-09-18 10:26:28 +02:00
Doron Somech
af03241dcb Revert "Problem: term "identity" is confusing" 2017-09-07 15:47:43 +03:00
sigiesec
e00131dd43 Problem: inconsistent naming related to routing ids
Solution: renamed routing_id fields in pipe_t, renamed ZMQ_CONNECT_RID to ZMQ_CONNECT_ROUTING_ID
2017-09-07 10:33:13 +02:00
sigiesec
1daf83079a Problem: term "identity" is confusing
Solution: replace by "routing id"
2017-09-06 17:45:56 +02:00
Luca Boccassi
b8695a47b5 Problem: proxy_steerable STATISTICS returns conflated buffers
Solution: split each stat into its own frame, to make it simpler and
easier to use it, especially from high level bindings
2017-09-06 01:28:28 +01:00
Luca Boccassi
78c4d33600 Problem: new STATISTICS proxy_steerable not behind DRAFT
Solution: ifdef it until it's declared stable
2017-09-05 17:37:52 +01:00
Luca Boccassi
c5aef5e078 Problem: compilation fails on 32 bit
Solution: trucate 64 bit stats in test_proxy, as it's much easier than
to try and print 64 unsigned integers in a portable way
2017-09-05 17:23:08 +01:00
f18m
4be9513443 Add "STATISTICS" command to zmq_proxy_steerable() (#2737)
* Issue #2736: Add STATISTICS command to zmq_proxy_steerable()
2017-09-05 17:05:04 +01:00
Luca Boccassi
0382118371 Problem: unused variable in test_wait_corner_cases
Solution: don't pass it
2017-09-01 19:55:51 +01:00
sigiesec
f3b268d84f Problem: no tests for error cases of zmq_socket_get_peer_state
Solution: added tests
2017-09-01 16:28:59 +02:00
sigiesec
eeccbbd6f8 Problem: test case fails with tcp transport
Solution: use inproc transport instead
2017-09-01 16:28:59 +02:00
sigiesec
fc334bc759 Problem: unclean and duplicated test code
Solution: refactoring
2017-09-01 16:28:59 +02:00
sigiesec
f70097c1cf Problem: test does not trigger HWM
Solution: modify order of operations, add diagnostic output
2017-09-01 16:28:59 +02:00
sigiesec
cda20260b3 Problem: missing call to zmq_poller_destroy
Solution: added call
2017-09-01 16:28:58 +02:00
sigiesec
efa86fe629 Problem: no test case using the proposed zmq_socket_get_peer_state function
Solution: added test case (with dummy implementation of zmq_socket_get_peer_state)
2017-09-01 16:28:58 +02:00
sigiesec
49e1b8b75f Problem: test case in main function
Solution: extracted test_basic function
2017-09-01 16:28:57 +02:00
Luca Boccassi
fab14a3cc1 Problem: support for CMake << 3.1 broken
Solution: remove redundant target_sources directive
2017-09-01 10:59:48 +01:00
sigiesec
7eebed56a5 Problem: no test for zmq_timers_timeout without any active timers
Solution: add test
2017-08-23 10:31:44 +02:00
sigiesec
6147e45a07 Problem: missing tests for zmq_timers_* corner cases, missing handling of such corner cases, code duplication, missing assertions in test code
Solution: add tests, add checks to timers_t, add match_by_id functor, add assertions
2017-08-23 09:41:34 +02:00
sigiesec
d072d57e2e Problem: no tests for zmq_timer_* with NULL timers argument
Solution: added tests
2017-08-23 09:41:22 +02:00
sigiesec
8b263d5820 Problem: test_timers.cpp sleep_ duplicates msleep from testutil
Solution: replace sleep_ my msleep
2017-08-23 09:05:10 +02:00
sigiesec
8ae91fdf9a Problem: no test cases for zmq_poller_add*, zmq_poller_modify*, zmq_poller_remove* corner cases
Solution: added test cases
2017-08-22 20:22:39 +02:00
sigiesec
68f416c0ca Problem: missing test case for zmq_poller_wait_all with negative number of events
Solution: add test case
2017-08-22 20:04:55 +02:00