Skip to content

Commit 7730316

Browse files
committed
don't run tests by default & make park_section_no_miss test less brittle in CI
1 parent c7bc75d commit 7730316

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ endif()
4747

4848
enable_testing()
4949

50-
option(THREAD_PARK_RUN_TESTS "Run tests" ON)
50+
option(THREAD_PARK_RUN_TESTS "Run tests" OFF)
5151
if (THREAD_PARK_RUN_TESTS)
5252
add_subdirectory(tests)
5353
endif ()

tests/park_section_no_miss/park_section_no_miss.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
static constexpr int NUM_ITERATIONS = 100;
1010

11-
static constexpr auto MAX_WAIT_MS = 500; // 0.5 seconds
11+
static constexpr auto MAX_WAIT_MS = 500;
1212

1313
int main() {
1414
tpark_handle_t *handle = tparkCreateHandle();
@@ -19,7 +19,7 @@ int main() {
1919
for (int i = 0; i < NUM_ITERATIONS && !stop.load(); i++) {
2020
// Sleep a *tiny* bit so consumer definitely has set "state=1"
2121
// but maybe hasn't called tparkParkWait yet.
22-
std::this_thread::sleep_for(std::chrono::milliseconds(10));
22+
std::this_thread::sleep_for(std::chrono::milliseconds(100));
2323

2424
// Attempt to wake — if consumer hasn't actually parked yet,
2525
// we want to verify we do *not* lose this wake.
@@ -36,7 +36,7 @@ int main() {
3636

3737
// 2) Simulate some short pause before actually calling parkWait
3838
// The producer may call tparkWake() in this window.
39-
std::this_thread::sleep_for(std::chrono::milliseconds(5));
39+
std::this_thread::sleep_for(std::chrono::milliseconds(50));
4040

4141
// 3) Actually park. But if the wake arrived "too early",
4242
// the state is already zero and we won't block.

0 commit comments

Comments
 (0)