test: replace Thread.sleep with Awaitility in integration tests#823
Open
dkropachev wants to merge 1 commit intoscylladb:scylla-4.xfrom
Open
test: replace Thread.sleep with Awaitility in integration tests#823dkropachev wants to merge 1 commit intoscylladb:scylla-4.xfrom
dkropachev wants to merge 1 commit intoscylladb:scylla-4.xfrom
Conversation
Replace fixed Thread.sleep calls with Awaitility's polling-based waiting in MetricsITBase, DefaultMetadataTabletMapIT, and MockResolverIT. This eliminates wasted wait time by polling for the expected condition instead of sleeping for a fixed duration. DriverBlockHoundIntegrationIT is left unchanged as its sleep is intentional for BlockHound testing.
a26bd19 to
e4e685b
Compare
nikagra
requested changes
Mar 2, 2026
| .pollInterval(Duration.ofMillis(50)) | ||
| .until(() -> isSessionLearnedTabletInfo(session)); | ||
| return true; | ||
| } catch (org.awaitility.core.ConditionTimeoutException e) { |
| .atMost(Duration.ofSeconds(CLUSTER_WAIT_SECONDS)) | ||
| .pollInterval(Duration.ofSeconds(1)) | ||
| .until(() -> countUpNodes(firstSession) == numberOfNodes); | ||
| } catch (org.awaitility.core.ConditionTimeoutException e) { |
| .atMost(Duration.ofSeconds(CLUSTER_WAIT_SECONDS)) | ||
| .pollInterval(Duration.ofSeconds(1)) | ||
| .until(() -> countUpNodes(session) == numberOfNodes); | ||
| } catch (org.awaitility.core.ConditionTimeoutException e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Thread.sleepcalls with Awaitility polling in integration testsMetricsITBase,DefaultMetadataTabletMapIT,MockResolverITDriverBlockHoundIntegrationITleft unchanged (intentional sleep for BlockHound)Test plan