(test): ioVTKTest randomly crashes
Description
Fix ioVTKTest random crash. Sometimes writer doesn't load the reconstructions in the same order than the reader saved it.
We need to force writer to load file in a specific order:
- prefix reconstruction filename by its index in reconstructionDB (like "0_Liver")
- sort filenames by alphabetical order, using the previous prefixed index, to ensure that reconstructions are loaded in the same order than the generated ones.
- add messages in CPPUNIT assert marco to help to find failing tests.
Closes #534 (closed)
How to test it?
Run multiple times ioVTKTest
before and after this correction.
I can be very dependent of your OS configuration, but sometimes files aren't loaded in the same order, so when you compare the Nth reconstruction with the Nth loaded reconstruction it can be false since the loading order was random.
you can use this shell command to launch the test many times
for i in {1..1000}; do echo Test n $i; ./bin/iovtktest.sh ioVTK::ut::ModelSeriesWriterTest::testWriteMeshes; done;
Additional tests to run
-
Linux -
Windows -
CI