Skip to content

[3.10] bpo-45835: Fix race condition in test_queue (GH-29601) #29612

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
merged 1 commit into from
Nov 18, 2021

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Nov 18, 2021

Some of the tests in test_queue had a race condition in which a
non-sentinel value could be enqueued after the final sentinel value
leading to not all the inputs being processed (and test failures).

This changes feed() to enqueue a sentinel once the inputs are exhausted,
which guarantees that the final queued object is a sentinel. This
requires the number of feeder threads to match the number of consumer
threads, but that's already the case in the relevant tests.
(cherry picked from commit df3e53d)

Co-authored-by: Sam Gross [email protected]

https://bugs.python.org/issue45835

Some of the tests in test_queue had a race condition in which a
non-sentinel value could be enqueued after the final sentinel value
leading to not all the inputs being processed (and test failures).

This changes feed() to enqueue a sentinel once the inputs are exhausted,
which guarantees that the final queued object is a sentinel. This
requires the number of feeder threads to match the number of consumer
threads, but that's already the case in the relevant tests.
(cherry picked from commit df3e53d)

Co-authored-by: Sam Gross <[email protected]>
@bedevere-bot bedevere-bot added the tests Tests in the Lib/test dir label Nov 18, 2021
@pitrou pitrou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 18, 2021
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @pitrou for commit 8ca349e 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Nov 18, 2021
@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

20 similar comments
@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

5 similar comments
@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a success ✅ .

@ambv ambv merged commit 5cf05c7 into python:3.10 Nov 18, 2021
@miss-islington miss-islington deleted the backport-df3e53d-3.10 branch November 18, 2021 16:05
@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

2 similar comments
@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a pending ❌ .

@miss-islington
Copy link
Contributor Author

@colesbury and @pitrou: Status check is done, and it's a success ✅ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants