From a9bf367d6eab33617c3d6019d5b07c330cd5da64 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Tue, 2 May 2023 15:44:21 -0700 Subject: [PATCH] Test if being the kind of program that calls yield() pays dividends for flaky CI failures --- test/cfoa/swap_tests.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/cfoa/swap_tests.cpp b/test/cfoa/swap_tests.cpp index 40180168..9fae85cd 100644 --- a/test/cfoa/swap_tests.cpp +++ b/test/cfoa/swap_tests.cpp @@ -191,6 +191,7 @@ namespace { if (idx % 100 == 0) { cv.notify_all(); } + std::this_thread::yield(); } done1 = true; @@ -201,6 +202,7 @@ namespace { for (auto const& val : vals2) { x2.insert(val); + std::this_thread::yield(); } done2 = true; @@ -214,6 +216,7 @@ namespace { } x1.swap(x2); ++num_swaps; + std::this_thread::yield(); } while (!done1 && !done2); });