-
Notifications
You must be signed in to change notification settings - Fork 99
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
IGNITE-21792 fix ItNodeTest#testFollowerStartStopFollowing flakiness #4990
base: main
Are you sure you want to change the base?
Conversation
…m individual statements
just to be safe use the old timeout added together + 5 seconds
Test ReportsI created a test environment where I tested the timeouts a bit to get a feel for whether everything was working as expected. Manual: tests are executed manually from an IDE (Intelij) Test Setup 1Specs:
Note: Other tests in the test suite begin to flake when the system was fully utilized, but not the test in question. Test Setup 2Specs:
Test Setup 3Github Action
20 runs: https://github.com/12rcu/ignite-3/actions/runs/12584096504 |
Hi, @12rcu! First of all, thank you for the great work and for your contribution. However, could you please explain how this PR fixes the flakiness of the test? I can see that you replaced the |
Hi @sashapolo, Yes, you're right, it would have worked just by increasing the timeout of the original calls. So in conclusion, the test is still flaky, but with my "fix" when the timeout is reached it will say so in the test reports, so it's easier to increase the timeout in the future if needed. |
What I did with the test reports is just to show that I think the timeout I put in is long enough to not trigger the flakiness regularly. |
@12rcu but
But the name of your PR clearly states that your code is intended to fix the flakiness of the test, is the description incorrect? |
@sashapolo In retrospect, it may not be the best name for the pull request, in my opinion the "fix" is not that the test will always succeed, but rather gives a better reason why it failed. Yes, the timeout changes the semantics of the test, the first loops technically have more time than the other loops, and this could change the behaviour of the test. In my opinion this is negligible in this test case as we want the test to always succeed and never timeout (so if we wait longer for some loops then others, it doesn't really change much). So why would I want to use the timeout annotation, even though it's semantically not the same:
But I am also happy to test the timeouts with the |
assertTrue( | ||
waitForCondition(() -> ((MockStateMachine) node.getOptions().getFsm()).getOnStartFollowingTimes() == 1, 5_000)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertTrue( | |
waitForCondition(() -> ((MockStateMachine) node.getOptions().getFsm()).getOnStartFollowingTimes() == 1, 5_000)); | |
assertTimeoutPreemptively(Duration.ofMillis(5_000), () -> { | |
assertEquals(1, ((MockStateMachine) node.getOptions().getFsm()).getOnStartFollowingTimes()); | |
}); |
I was just digging around in the Junit documentation and noticed that there is an assert function specifically for this: see #4990 (comment) |
I would like to stress the difference between
If we are getting exceptions when executing If you are instead trying to improve the error message, then you can just add a better error message to the |
@sashapolo Now I understand you, yes you are absolutely right, it seems I was just lucky not to trigger a failure. I will convert this PR back to a draft and look for a better solution. |
Thank you, will be looking forward to your future contributions. |
https://issues.apache.org/jira/browse/IGNITE-21792
Thank you for submitting the pull request.
To streamline the review process of the patch and ensure better code quality
we ask both an author and a reviewer to verify the following:
The Review Checklist
- There is a single JIRA ticket related to the pull request.
- The web-link to the pull request is attached to the JIRA ticket.
- The JIRA ticket has the Patch Available state.
- The description of the JIRA ticket explains WHAT was made, WHY and HOW.
- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
Notes
Issue Notes:
Since the Jira ticket was not created by me, here is the summary of what was done:
@Timeout
annotation with the summed time of the individual assert statements.@timeout
of 10 seconds, the final timeout is 25 seconds.)