-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Non-deterministic tests #95
Non-deterministic tests #95
Conversation
Feature/circleci fix
I've just see that just failed on my Circle CI 😠 I'll keep trying to find it out. |
Unfortunately, I've lost a lot of time trying to simulate non-deterministic failing locally. |
@pcowgill after trying a lot, I couldn't make this test to work well. Note: Without this non-deterministic test I've rerun CI workflow 10 times and all passed. |
These findings are perplexing and interesting. Thanks for being so thorough here. One take-home point is that we should continue to keep an eye out for continuing to make sure each test is isolated as one of our ongoing efforts going forward. Often if a test isn't deterministic, there's a race condition for whether something async is finishing or not, and we're not properly awaiting the async thing before moving on. So let's keep an eye out for something like that. It might even turn out that it's related to #76 , but I would have to give that more thought to decide if it could make sense. That's just a quick gut reaction, so those might not even be possibly related.
That's too bad it ended up being different when you set up the CircleCI env locally - sorry that wasn't more straightforward.
That sounds like a sensible next step - thanks!
Great! |
@marcelomorgado Oh, and despite us being stuck with some further things to investigate here, I meant to say that I'm really impressed with all the steps you took above! |
@marcelomorgado I’m merging this now so as not to interfere with any testing you’ll be doing on other micro-PRs you may want to open. But please check out the comments on this PR after the merge to see whether we should track any more issues. Thanks! |
Issue link
Refs #94
Types of changes
Bug fix (non-breaking change that fixes an issue)
Steps
1. Run
tasit-action
test suite 50 times. Results:Testcase: Contract messages/transaction subscriptions tests should emit error event when orphan/uncle block occurs
Failed 9 times. Same error.
2. Skipping reliable slower for next rounds (saving 4s).
3. Run non-deterministic the test case 50 times.
Passed all times.
Note: Seems isolation doesn't work well.
4. Implement
ganache-cli
snapshot/revert inbeforeEach
/afterEach
5. Run
tasit-action
test suite 50 times again. Results:All passed 😃 .
6. Came back with the skipped slow test case and ran test suite 10 times.
All passed.
7. Run
tasit-sdk
test suite 10 times.All passed.
Notes:
- Oddly one of both test cases identified as non-deterministic ("should watch contract's ValueChanged event") doesn't failed at all.
- If non-deterministic tests still happen on CI, the next step will be using same container env locally to check.