Increate test timeouts for ServersCheckerTest #15032
Merged
+7
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
From time to time these tests fail on our CI job.
I'm able to reproduce this issue locally if my laptop is quite loaded with another process like maven build. And as we can see the first test takes the most time.
I did not find any information about why it may happen but I assume that it's related to memory allocation.
I wrote a simple test that does nothing except N Objects
and it's what I get:
I assume that it's a situation similar to what we have in ServersCheckerTest.java, when not much memory is needed and the first test always takes the most time. I assume that the process during the first test allocates some amount of memory and further tests just reuse it.
I don't have a clear explanation of why 2nd and 3rd take the most time but it's not really needed.
My testing is not accurate at all and its purpose was just to show that using timeout needs additional care since invocation time may take different time depending on which it will be run(1,2,3,...), which time(a system is loaded, a garbage collector is active).
I believe 5 seconds should be even more than enough for tests to be stable.
In the pessimistic scenario (when there is an error in code or tests) we may pay 7*5=35 seconds of build time, but such a situation must happen only feature branch, where code is broken but not in master.
What issues does this PR fix or reference?
N/A
Release Notes
N/A
Docs PR
N/A