Skip to content

test: Fix flaky MonitoreCacheTest case that needs to wait for a background task#2133

Merged
hessjcg merged 1 commit intomainfrom
socket-memory-leak-testcase
Mar 27, 2025
Merged

test: Fix flaky MonitoreCacheTest case that needs to wait for a background task#2133
hessjcg merged 1 commit intomainfrom
socket-memory-leak-testcase

Conversation

@hessjcg
Copy link
Copy Markdown
Collaborator

@hessjcg hessjcg commented Mar 27, 2025

No description provided.

@hessjcg hessjcg requested a review from a team as a code owner March 27, 2025 16:03
@hessjcg hessjcg requested a review from jackwotherspoon March 27, 2025 16:07

// Wait for the MonitoredCache task to clean up the socket, up to 500ms.
for (int i = 0; cache.getOpenSocketCount() > 0 && i < 10; i++) {
Thread.sleep(50);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should this be 500? Comment says 500 milliseconds...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This waits 50ms up to 10 times, for a possible max of 500ms waiting.

@hessjcg hessjcg merged commit 72eff29 into main Mar 27, 2025
17 checks passed
@hessjcg hessjcg deleted the socket-memory-leak-testcase branch March 27, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants