OpenAWE icon indicating copy to clipboard operation
OpenAWE copied to clipboard

Test ThreadPool.multipleJobs fails sometimes

Open Jackkal opened this issue 1 year ago • 1 comments

$ctest -R ThreadPool.multipleJobs --repeat until-fail:100
...
    Start 84: ThreadPool.multipleJobs
    Test #84: ThreadPool.multipleJobs ..........   Passed    0.01 sec
    Start 84: ThreadPool.multipleJobs
    Test #84: ThreadPool.multipleJobs ..........   Passed    0.01 sec
    Start 84: ThreadPool.multipleJobs
    Test #84: ThreadPool.multipleJobs ..........   Passed    0.01 sec
    Start 84: ThreadPool.multipleJobs
    Test #84: ThreadPool.multipleJobs ..........***Failed    0.01 sec
	
$ctest -R ThreadPool.multipleJobs --repeat until-fail:100 --verbose
...	
84: Test command: /home/jackkal/code/OpenAWE/build/awe_test "--gtest_filter=ThreadPool.multipleJobs"
84: Test timeout computed to be: 1500
84: Running main() from /home/jackkal/code/googletest/googletest/src/gtest_main.cc
84: Note: Google Test filter = ThreadPool.multipleJobs
84: [==========] Running 1 test from 1 test suite.
84: [----------] Global test environment set-up.
84: [----------] 1 test from ThreadPool
84: [ RUN      ] ThreadPool.multipleJobs
84: /home/jackkal/code/OpenAWE/test/test_common_threadpool.cpp:40: Failure
84: Expected equality of these values:
84:   test2.load()
84:     Which is: 119
84:   120

I did not do a root cause analysis yet, but this is possibly related to the check !Threads.empty() which checks if the queue is empty, but this does not necessarily mean that the last task has finished.

Jackkal avatar Jul 14 '24 16:07 Jackkal

Thanks for the hint, this is indeed a problem the empty() method. I will look into it, when I have some time.

Nostritius avatar Jul 17 '24 17:07 Nostritius