-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Randomize execution of sibling scopes/resets #4
Comments
The big question for me is how this might affect existing tests that depend of consistent execution order... Also problematic is that fact that I can't create new command line flags. So, the only option is to use invalid values for existing ones (like I've done with json reporting). |
@mdwhatcott Now that tests run concurrently, I've noticed a sort of pseudo-randomness in test execution. Is this good enough, or do we want to provide random seeds and let the user specify one, etc, etc...? |
It's more about making sure that unit tests run in any order without any effect on the end result. I've been in situations with frameworks that do randomize execution and have uncovered subtle bugs that hide when you only see the tests executed in deterministic order. The purist in me says we have to have this right now ("How dare we call this a robust testing framework without it!?"). The pragmatist says wait until we get burned by not having it (and I'm still hung up about the command line flag hack that will be required--see my last comment). |
This issue is somewhat related to #70. If we can resolve that issue successfully we could rely on |
Not quite sure how to go about this yet so we are deferring this issue. It will be referenced on the wiki for future discussion. |
Out of curiosity, would it be enough to:
It gets a bit tricky to do with the way that it's doing greedy suite execution right now (e.g. it will execute the first !complete Convey in every suite if expectChildRun is true). If we did this randomized execution, there'd have to be more passes through the test in order to do breadth-first evaluation of Conveys.. since every suite can also have initialization side effects, this would mean that we'd have to restart execution from the top-most suite every time we encountered a new suite that we hadn't seen before. |
Having just rewritten most of the The tests would certainly have to be re-thought--they count on deterministic execution order pretty heavily. Maybe there could be a setting that enables random execution? (sigh...) I'd be interested to try it out though. |
Probably will need options like edited because github thought I had a weird html tag in there |
This is to drive out temporal couplings between tests. Technically, the setup and teardown methods should be enough to do this but you just never know...
I think this will be a command line option that is enabled by default and can be disabled (which is how some of the unit tests can avoid being broken by this new feature).
The text was updated successfully, but these errors were encountered: