Skip to content
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

Fix Another Flaky Test #7754

Merged
merged 1 commit into from
Jan 27, 2023
Merged

Fix Another Flaky Test #7754

merged 1 commit into from
Jan 27, 2023

Conversation

adamgfraser
Copy link
Contributor

This test is flaky as written because we repeat until the acquire workflow has completed for the first ten items in the pool as a way of waiting for the pool to be fully initialized. However, an item can be acquired momentarily before it is added to the queue of items to be taken from the pool. So it is possible that:

  1. The first nine items in the pool are initialized
  2. The tenth item in the pool is acquired but has not yet been added to the queue
  3. The subsequent calls to get are executed, causing new items to be acquired because the original one fails
  4. One of these items is added to the internal queue before the original tenth item is added to the queue

We could add further coordination to prevent this from occurring but I don't think this is a problem. The pool is correct to allocate a new item once one of the calls to get returns a failure and I don't think there is any guarantee that an in process item from initialization must be returned by the pool before an item allocated after failure of an entry.

@jdegoes jdegoes merged commit d825736 into zio:series/2.x Jan 27, 2023
@adamgfraser adamgfraser deleted the pool branch January 27, 2023 13:10
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.

None yet

2 participants