Skip to content

Remove needless use of assertBusy polling Future.isDone #119078

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

Merged

Conversation

original-brownbear
Copy link
Contributor

Polling Future.isDone is obviously nonsense. Surprisingly, We can save a couple seconds fixing up these spots (especially the CCS ones).
Seemingly this also fixes testCancel (tested by unmuting) but I left it muted for now to be investigated in the dedicated issue for that.
Adding search label since most of the fixed tests are from search.

Polling `Future.isDone` is obviously nonesense. Suprisingly enough, We can save a couple
seconds fixing up these spots (especially the CCS ones).
@original-brownbear original-brownbear added >non-issue :Search/Search Search-related issues that do not fall into other categories labels Dec 19, 2024
@elasticsearchmachine elasticsearchmachine added Team:Search Meta label for search team v9.0.0 labels Dec 19, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@@ -183,7 +183,11 @@ public void testProxyConnectionDisconnect() throws Exception {
}
}
});
assertBusy(() -> assertTrue(future.isDone()));
try {
future.get();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should you use a timed get to avoid an infinite wait scenario?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question :) "infinite wait" practically means 20min with the suite timeout we have in place.
To be honest, I kinda like not putting timeouts on these things personally. If the listener leaks due to a bug, yes CI will run for 20 min, but so be it? :) If I fail after a 20 min wait, I'm close to 100% sure it wasn't a slow CI run that failed things. Otoh, if it's a 10s wait ... the first thing my mind will jump to is wonder if we conceivably could have had have a 10s GC or so pause here :)
-> personally I wouldn't add timeouts on future.get() in tests anywhere pretty much I think.

@original-brownbear original-brownbear added auto-backport Automatically create backport pull requests when merged v8.18.0 labels Dec 19, 2024
@original-brownbear original-brownbear merged commit 71d88e3 into elastic:main Dec 19, 2024
16 checks passed
@original-brownbear original-brownbear deleted the remove-pointless-busy-wait branch December 19, 2024 19:18
original-brownbear added a commit to original-brownbear/elasticsearch that referenced this pull request Dec 19, 2024
Polling `Future.isDone` is obviously nonesense. Suprisingly enough, We can save a couple
seconds fixing up these spots (especially the CCS ones).
elasticsearchmachine pushed a commit that referenced this pull request Dec 19, 2024
…19138)

Polling `Future.isDone` is obviously nonesense. Suprisingly enough, We can save a couple
seconds fixing up these spots (especially the CCS ones).
navarone-feekery pushed a commit to navarone-feekery/elasticsearch that referenced this pull request Dec 26, 2024
Polling `Future.isDone` is obviously nonesense. Suprisingly enough, We can save a couple
seconds fixing up these spots (especially the CCS ones).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >non-issue :Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants