diff --git a/CMakeLists.txt b/CMakeLists.txt index 508da988..182d257a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ if(CMAKE_HOST_WIN32 AND DEFINED CMAKE_TOOLCHAIN_FILE AND CMAKE_TOOLCHAIN_FILE MA set(VCPKG_TARGET_TRIPLET "x64-windows-static" CACHE STRING "Vcpkg target triplet" FORCE) endif() -project(acecode VERSION 1.0.15 LANGUAGES C CXX) +project(acecode VERSION 1.0.16 LANGUAGES C CXX) include(${CMAKE_SOURCE_DIR}/cmake/acecode_source_guards.cmake) diff --git a/tests/desktop/daemon_pool_test.cpp b/tests/desktop/daemon_pool_test.cpp index c627cb5b..9e179355 100644 --- a/tests/desktop/daemon_pool_test.cpp +++ b/tests/desktop/daemon_pool_test.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -444,15 +445,18 @@ TEST(DaemonPool, AttachedDaemonStopsWhenKeepAliveIsDisabled) { } TEST(DaemonPool, IncompatibleManagedDaemonIsStoppedBeforeReplacementSpawn) { + // A normal mock PID can belong to an unrelated process on a busy runner. + const auto stopped_pid = (std::numeric_limits::max)(); + ASSERT_FALSE(acecode::daemon::is_pid_alive(stopped_pid)); auto state = std::make_shared(); DaemonPool pool; pool.set_supervisor_factory_for_test([&] { return std::unique_ptr(new MockSupervisor(state)); }); - pool.set_existing_daemon_probe_for_test([](const ActivateRequest&) { + pool.set_existing_daemon_probe_for_test([stopped_pid](const ActivateRequest&) { ExistingDaemonProbeResult existing; existing.action = ExistingDaemonAction::Replace; - existing.pid = 4242; + existing.pid = stopped_pid; existing.guid = "old-guid"; existing.reason = "protocol mismatch"; return existing; diff --git a/tests/web/web_server_smoke_test.cpp b/tests/web/web_server_smoke_test.cpp index 40a86607..c65ee6b9 100644 --- a/tests/web/web_server_smoke_test.cpp +++ b/tests/web/web_server_smoke_test.cpp @@ -13510,11 +13510,13 @@ std::vector wait_for_user_messages( std::vector users; const auto deadline = std::chrono::steady_clock::now() + 10s; while (std::chrono::steady_clock::now() < deadline) { - users.clear(); - for (const auto& message : entry.loop->messages()) { - if (acecode::is_real_user_message(message)) users.push_back(message); - } - if (users.size() >= expected_count && !entry.loop->is_busy()) break; + const bool idle = entry.loop->try_run_idle_control([&] { + users.clear(); + for (const auto& message : entry.loop->messages()) { + if (acecode::is_real_user_message(message)) users.push_back(message); + } + }); + if (idle && users.size() >= expected_count) break; std::this_thread::sleep_for(10ms); } return users; diff --git a/vcpkg.json b/vcpkg.json index 4d0c4f10..734d0c6c 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "acecode", - "version-semver": "1.0.15", + "version-semver": "1.0.16", "dependencies": [ "cpr", {