|
FhSim
3.1.0
Marine systems simulation
|
| ID | 0101 |
| Class | TEST |
| Severity | 1 |
| Status | ready |
Models: —
Found: 2026-10-24
Seen once in feature fhsim-review-fixes, in a full ctest run while two other fhsim builds loaded the machine: BatchPool.StopWorkers_JoinsTheThreads failed with a thread count of 1 where 2 was expected. It passed in every rerun, alone and in the full suite. A second full -j6 run once failed the fhsim gtest entry at about 4 s, with no output saved; probably the same test.
tests/core/fhUtilities/BatchPool_test.cpp:270-280:
ThreadCount() reads /proc/self/task. A thread that an earlier test joined can still be listed for a short while (the test file already notes this), so before can be read too high or too low depending on when the kernel drops it. Not reproduced; this is the likely cause, not a proven one.
A red fast tier with no code defect; no user effect.
Sample before only after the count is stable (poll ThreadCount() until two reads agree, with a short bound), as ThreadCountOnceDroppedTo already does for the after side.
Run the test 1000 times under stress --cpu 32 (or with other test binaries in parallel) before and after the change.
Low; test-only change.