updated uses of random number generation in tests so that we log the …#2631
updated uses of random number generation in tests so that we log the …#2631corranrogue9 wants to merge 2 commits intomasterfrom
Conversation
|
|
||
| var rand = new Random(RandomSeedGenerator.GetRandomSeed()); | ||
| var seed = RandomSeedGenerator.GetRandomSeed(); | ||
| Trace.WriteLine($"Generated seed for random number generator: {seed}"); |
There was a problem hiding this comment.
where do you retrieve the trace information? If it's running on Azure pipeline, is it easy to trace?
Different test cases output the same trace, is it easy to identify?
There was a problem hiding this comment.
I guess I am only expecting someone to need the seed in the event of an intermittent test failure that needs to be investigated, so in the pipeline logs, when it logs the failed test, the trace will be right above the name of the failed test
There was a problem hiding this comment.
Are you thinking I should add the test name to the message or something along those lines?
There was a problem hiding this comment.
@xuzhg, I've updated the change so that we only log 1 time. It is relatively straightforward to find the seed in the build logs.
481bfba to
efaa207
Compare
b0d9127 to
8388bee
Compare
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
…used for later investigation
Description
Some tests use a random number generated when creating data. This can cause tests to fail intermittently. This PR logs the seed used for random number generation so that those intermittent failures can be reproduced for investigation.
Checklist (Uncheck if it is not completed)
Additional work necessary
No additional work necessary.