MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_many_threads

Method test_many_threads

Lib/test/test_queue.py:967–975  ·  view source on GitHub ↗
(self, size)

Source from the content-addressed store, hash-verified

965
966 @bigmemtest(size=50, memuse=100*2**20, dry_run=False)
967 def test_many_threads(self, size):
968 # Test multiple concurrent put() and get()
969 q = self.q
970 inputs = list(range(10000))
971 results = self.run_threads(size, q, inputs, self.feed, self.consume)
972
973 # Multiple consumers without synchronization append the
974 # results in random order
975 self.assertEqual(sorted(results), inputs)
976
977 @bigmemtest(size=50, memuse=100*2**20, dry_run=False)
978 def test_many_threads_nonblock(self, size):

Callers

nothing calls this directly

Calls 4

run_threadsMethod · 0.95
listClass · 0.85
sortedFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected