(self)
| 44 | ] |
| 45 | |
| 46 | def test_thread_stress(self): |
| 47 | def create(): |
| 48 | return None |
| 49 | |
| 50 | pool = FixedPool(create) |
| 51 | |
| 52 | def thread_fn(): |
| 53 | with pool.acquire(): |
| 54 | pass |
| 55 | |
| 56 | threads = [] |
| 57 | for i in range(1024): |
| 58 | t = threading.Thread(target=thread_fn) |
| 59 | t.start() |
| 60 | threads.append(t) |
| 61 | |
| 62 | for t in threads: |
| 63 | t.join() |