quartznet
quartznet copied to clipboard
Testing quartz scheduler in xUnit
Describe the bug
The Scheduler not running as expected when testing with xUnit
Version used
v3.2.3, on .Net Core 3.1
To Reproduce
- Run all the test.
- Remove the
Skip
parameter onShould_Mark_Book_As_Available
test. - Run
Should_Mark_Book_As_Available
test separately. - Run all the test again.
Expected behavior
Every tests should all be pass.
Additional context
- This test demo using quartz scheduler integrated in Masstransit.
- The test
Should_Mark_Book_As_Available
often failed.(not always fail, just most of the times, and always passed if running separately).
A temporary workaround
Put the [assembly: CollectionBehavior(DisableTestParallelization = true)]
for all the test to run sequentially.