-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Labels
P2Critical bugs or normal featuresCritical bugs or normal featurestype:enhancementNew framework feature or requestNew framework feature or requesttype:test coverage gapThis requires a new test case, not just fixing oneThis requires a new test case, not just fixing one
Description
The test scripts use random number generator to e.g. change the sleep times.
This is wonderful for stress tests, but a really bad idea for CI and daily tests, since by definition these tests cannot be reproduced UNLESS the seed is known.
We should add one option to tests that use random numbers, so that by default we shall use the same seed - 42
https://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#Answer_to_the_Ultimate_Question_of_Life,_the_Universe,_and_Everything_(42)
When the user wishes more randomness, the seed shall be saved in the logs so that we can reproduce failures.
This can be done in bash with the RANDOM variable
Normal case:
$ T=42
$ RANDOM=$T; echo $RANDOM; echo $RANDOM; echo $RANDOM
17766
11151
23481
$ RANDOM=$T; echo $RANDOM; echo $RANDOM; echo $RANDOM
17766
11151
23481stress-test:
$ T=$(date +%s)
$ echo $T
1596129567
$ RANDOM=$T; echo $RANDOM; echo $RANDOM;
19204
11943
$ RANDOM=$T; echo $RANDOM; echo $RANDOM;
19204
11943
$ RANDOM=$T; echo $RANDOM; echo $RANDOM;
19204
11943cc:
marc-hb
Metadata
Metadata
Assignees
Labels
P2Critical bugs or normal featuresCritical bugs or normal featurestype:enhancementNew framework feature or requestNew framework feature or requesttype:test coverage gapThis requires a new test case, not just fixing oneThis requires a new test case, not just fixing one