0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

Merge pull request #3808 from sigiesec/fix-test-monitor-to-be-checked

Fix intermittent test_monitor and test_security_zap timeouts/deadlocks for now
This commit is contained in:
Luca Boccassi 2020-02-04 15:23:58 +01:00 committed by GitHub
commit 84ec65482f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -116,6 +116,12 @@ void test_monitor_basic ()
if (event != ZMQ_EVENT_DISCONNECTED) {
TEST_ASSERT_EQUAL_INT (ZMQ_EVENT_MONITOR_STOPPED, event);
}
// TODO: When not waiting until the monitor stopped, the I/O thread runs
// into some deadlock. This must be fixed, but until it is fixed, we wait
// here in order to have more reliable test execution.
while (event != ZMQ_EVENT_MONITOR_STOPPED) {
event = get_monitor_event (server_mon, NULL, NULL);
}
// Close down the sockets
// TODO why does this use zero_linger?
@ -255,6 +261,12 @@ void test_monitor_versioned_basic (bind_function_t bind_function_,
if (event != ZMQ_EVENT_DISCONNECTED) {
TEST_ASSERT_EQUAL_INT (ZMQ_EVENT_MONITOR_STOPPED, event);
}
// TODO: When not waiting until the monitor stopped, the I/O thread runs
// into some deadlock. This must be fixed, but until it is fixed, we wait
// here in order to have more reliable test execution.
while (event != ZMQ_EVENT_MONITOR_STOPPED) {
event = get_monitor_event_v2 (server_mon, NULL, NULL, NULL);
}
free (client_local_address);
free (client_remote_address);

View File

@ -346,6 +346,7 @@ void shutdown_context_and_server_side (void *zap_thread_,
zmq_unbind (zap_control_, "inproc://handler-control"));
}
test_context_socket_close (zap_control_);
zmq_socket_monitor (server_, NULL, 0);
test_context_socket_close (server_mon_);
test_context_socket_close (server_);