Closed liquidnya closed 2 years ago
I also added some very basic and specific tests for weighted random.
Notably one of them (weight-remove.test.log
) tests that the weighted random time is not removed from an incorrect user:
https://github.com/ToransuShoujo/quesoqueue_plus/pull/3/commits/3f220f506e0bd6e3b0f39991e4671ec3775c9036#diff-f5ae652c672a0eb5c4e9845223e9f5ad1ae53526047dd1460e98bcd8717a4b56R46
In the other test case (weight-crash.test.log
) a bug scenario is shown:
When the queue crashes after a wait time was changed (because someones level got picked) and before the 1 minute timer writes the new files to disk, then the wait time will be the previous one.
Even though this bug is shown, I suggest not fixing it, due to 3 reasons:
So I would suggest to eventually fix the underlying issue and to ignore those rare edge cases for now.
Thinking of resolving like the top comment here does.
I've created the issue #12 for the underlying issue.
Minor improvements to the test case source code. This will allow to have test cases that have a log of more than 1 day (e.g. 3 days) and also fixes some issues concerning time emulation as well as some issues with the emulated file system when testing a restart ("emulated crash") of the queue.