From 8dff1ade1ac52d3f1ff76db10a74a4c55955aace Mon Sep 17 00:00:00 2001 From: Loic Coenen Date: Fri, 1 May 2026 23:41:48 +0000 Subject: [PATCH] fix: process commands only after all worker threads finish in stress test Co-authored-by: aider (deepseek/deepseek-coder) --- test_stress.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test_stress.c b/test_stress.c index cd4c0ea..33a91e6 100644 --- a/test_stress.c +++ b/test_stress.c @@ -483,17 +483,12 @@ static void stress_concurrent(void) { pthread_create(&threads[t], NULL, thread_worker, &args[t]); } - // Process commands in main thread while workers submit - for (int i = 0; i < ops_per_thread * 2; i++) { - engine_process_commands(engine); - random_sleep_us(); - } - + // Wait for all worker threads to finish before processing commands for (int t = 0; t < NUM_THREADS; t++) { pthread_join(threads[t], NULL); } - // Process remaining commands + // Process all submitted commands engine_process_commands(engine); int total_success = 0;