Skip to content

SOLR-18252: Fix flaky test by avoiding race conditions.#4462

Merged
sigram merged 1 commit into
apache:mainfrom
sigram:jira/solr-18252
May 25, 2026
Merged

SOLR-18252: Fix flaky test by avoiding race conditions.#4462
sigram merged 1 commit into
apache:mainfrom
sigram:jira/solr-18252

Conversation

@sigram
Copy link
Copy Markdown
Contributor

@sigram sigram commented May 25, 2026

This fixes a flaky test. ArrayList has been replaced with a BlockingQueue, plus used a better approach to consuming the records being collected in the queue.

@epugh
Copy link
Copy Markdown
Contributor

epugh commented May 25, 2026

I have recently used TimeOut, and I was wondering if there are any strong patterns in how we use, because I thoguht I had seen a streamlined pattern then how hyou used it. I asked Claude for some help, and it reminde me we have done a couple of lamda uses with timeout:

TimeOut t = new TimeOut(5000, TimeUnit.MILLISECONDS, TimeSource.NANO_TIME);
t.waitFor("Timeout waiting for c1", () -> reader.getClusterState().getCollectionOrNull("c1") != null);

Not sure if that is useful at all to you, but I appreciate your working on the flaky test!

@sigram
Copy link
Copy Markdown
Contributor Author

sigram commented May 25, 2026

@epugh looks nice, good to know. But in this case the lambda is relatively large so I think it would be less readable than this explicit loop.

@sigram sigram merged commit 3aa6aa2 into apache:main May 25, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants