Skip to content

Commit c25f595

Browse files
authored
Merge pull request zeromq#576 from gummif/gfa/monitor-test-flaky
Problem: Intermittent monitor test failures
2 parents 381f699 + 918be1d commit c25f595

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
libzmqbuild: false
8282
brewinstall: "zeromq"
8383
# windows
84-
- os: "windows-2016"
84+
- os: "windows-2019"
8585
cppstd: "14"
8686
cc: "msbuild"
8787
cxx: "msbuild"

tests/monitor.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
class mock_monitor_t : public zmq::monitor_t
1010
{
1111
public:
12-
void on_event_connect_delayed(const zmq_event_t &, const char *) ZMQ_OVERRIDE
13-
{
14-
++connect_delayed;
15-
++total;
16-
}
1712

1813
void on_event_connected(const zmq_event_t &, const char *) ZMQ_OVERRIDE
1914
{
@@ -22,7 +17,6 @@ class mock_monitor_t : public zmq::monitor_t
2217
}
2318

2419
int total{0};
25-
int connect_delayed{0};
2620
int connected{0};
2721
};
2822

@@ -79,15 +73,14 @@ TEST_CASE("monitor init event count", "[monitor]")
7973
common_server_client_setup s{false};
8074
mock_monitor_t monitor;
8175

82-
const int expected_event_count = 2;
76+
const int expected_event_count = 1;
8377
monitor.init(s.client, "inproc://foo");
8478

8579
CHECK_FALSE(monitor.check_event(0));
8680
s.init();
8781

88-
while (monitor.check_event(100) && monitor.total < expected_event_count) {
82+
while (monitor.check_event(1000) && monitor.total < expected_event_count) {
8983
}
90-
CHECK(monitor.connect_delayed == 1);
9184
CHECK(monitor.connected == 1);
9285
CHECK(monitor.total == expected_event_count);
9386
}
@@ -137,7 +130,6 @@ TEST_CASE("monitor init abort", "[monitor]")
137130
CHECK(cond_var.wait_for(lock, std::chrono::seconds(1),
138131
[&done] { return done; }));
139132
}
140-
CHECK(monitor.connect_delayed == 1);
141133
CHECK(monitor.connected == 1);
142134
monitor.abort();
143135
thread.join();

0 commit comments

Comments
 (0)