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;