8000 gh-133454: Mark test_queue tests with many threads as bigmem by serhiy-storchaka · Pull Request #134575 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-133454: Mark test_queue tests with many threads as bigmem #134575

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations < 8000 /summary>
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Lib/test/test_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import time
import unittest
import weakref
from test.support import gc_collect
from test.support import gc_collect, bigmemtest
from test.support import import_helper
from test.support import threading_helper

Expand Down Expand Up @@ -963,33 +963,33 @@ def test_order(self):
# One producer, one consumer => results appended in well-defined order
self.assertEqual(results, inputs)

def test_many_threads(self):
@bigmemtest(size=50, memuse=100*2**20, dry_run=False)
def test_many_threads(self, size):
# Test multiple concurrent put() and get()
N = 50
q = self.q
inputs = list(range(10000))
results = self.run_threads(N, q, inputs, self.feed, self.consume)
results = self.run_threads(size, q, inputs, self.feed, self.consume)

# Multiple consumers without synchronization append the
# results in random order
self.assertEqual(sorted(results), inputs)

def test_many_threads_nonblock(self):
@bigmemtest(size=50, memuse=100*2**20, dry_run=False)
def test_many_threads_nonblock(self, size):
# Test multiple concurrent put() and get(block=False)
N = 50
q = self.q
inputs = list(range(10000))
results = self.run_threads(N, q, inputs,
results = self.run_threads(size, q, inputs,
self.feed, self.consume_nonblock)

self.assertEqual(sorted(results), inputs)

def test_many_threads_timeout(self):
@bigmemtest(size=50, memuse=100*2**20, dry_run=False)
def test_many_threads_timeout(self, size):
# Test multiple concurrent put() and get(timeout=...)
N = 50
q = self.q
inputs = list(range(1000))
results = self.run_threads(N, q, inputs,
results = self.run_threads(size, q, inputs,
self.feed, self.consume_timeout)

self.assertEqual(sorted(results), inputs)
Expand Down
Loading
0