JetBrains / lincheck

Framework for testing concurrent data structures
Mozilla Public License 2.0
564 stars 33 forks source link

Run init/post parts of the scenario in the 1st thread #146

Closed eupp closed 1 year ago

eupp commented 1 year ago

Currently init and post parts of the scenario are run in the main thread. If some actor running in init/post part hungs, the lincheck hangs as well. Because of the similar reason, exceptions thrown in init/post part are not handled properly: instead of returning UnexpectedExceptionFailure lincheck fails with the thrown exception.

This PR fixes these problems. It fixes the runner and executor classes, so that init and post parts of the scenario are also run in separate threads.

New tests to check for hung and exception handling in init/post parts are added as well.

eupp commented 1 year ago

@ndkoval ready for review

eupp commented 1 year ago

I rebased the branch on recent develop to resolve the conflicts. Regarding the remaining refactorings, I propose to proceed with them after we will fix #196.

As for the performance, according to the CI builds, master and develop took around 20 mins, while this branch takes ~22 mins, so it looks like there is no significant performance degradation. I also do not see any degradation on my local machine.

CC @ndkoval

ndkoval commented 1 year ago

Please also rebase on develop