From 326a994c5ff9d2d47b21c4d30c0d31045f896df4 Mon Sep 17 00:00:00 2001 From: Gudmundur Adalsteinsson Date: Sun, 9 Oct 2022 13:53:58 +0000 Subject: [PATCH 1/2] Problem: Intermittent monitor test failures Solution: Do not require delayed connection event --- tests/monitor.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/tests/monitor.cpp b/tests/monitor.cpp index a17b9c4..09d5381 100644 --- a/tests/monitor.cpp +++ b/tests/monitor.cpp @@ -9,11 +9,6 @@ class mock_monitor_t : public zmq::monitor_t { public: - void on_event_connect_delayed(const zmq_event_t &, const char *) ZMQ_OVERRIDE - { - ++connect_delayed; - ++total; - } void on_event_connected(const zmq_event_t &, const char *) ZMQ_OVERRIDE { @@ -22,7 +17,6 @@ public: } int total{0}; - int connect_delayed{0}; int connected{0}; }; @@ -79,15 +73,14 @@ TEST_CASE("monitor init event count", "[monitor]") common_server_client_setup s{false}; mock_monitor_t monitor; - const int expected_event_count = 2; + const int expected_event_count = 1; monitor.init(s.client, "inproc://foo"); CHECK_FALSE(monitor.check_event(0)); s.init(); - while (monitor.check_event(100) && monitor.total < expected_event_count) { + while (monitor.check_event(1000) && monitor.total < expected_event_count) { } - CHECK(monitor.connect_delayed == 1); CHECK(monitor.connected == 1); CHECK(monitor.total == expected_event_count); } @@ -137,7 +130,6 @@ TEST_CASE("monitor init abort", "[monitor]") CHECK(cond_var.wait_for(lock, std::chrono::seconds(1), [&done] { return done; })); } - CHECK(monitor.connect_delayed == 1); CHECK(monitor.connected == 1); monitor.abort(); thread.join(); From 918be1d175cbb776ebb5a660aebd96eafe0714d7 Mon Sep 17 00:00:00 2001 From: Gudmundur Adalsteinsson Date: Sun, 9 Oct 2022 14:02:06 +0000 Subject: [PATCH 2/2] Update deprecated CI OS --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 044a85a..ccceb96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: libzmqbuild: false brewinstall: "zeromq" # windows - - os: "windows-2016" + - os: "windows-2019" cppstd: "14" cc: "msbuild" cxx: "msbuild"