Skip to content

Commit f649f7b

Browse files
committed
fix: test
1 parent 6a51f51 commit f649f7b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/test_concurrency.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ def test_success_and_failure_isolation(self):
2121
manager = multiprocessing.Manager()
2222
success_counter = manager.Value("i", 0)
2323
fail_counter = manager.Value("i", 0)
24+
process_index = manager.Value("i", 0)
2425
lock = manager.Lock()
2526

2627
def fake_bootstrap_run(handler, lambda_runtime_client):
27-
pid = multiprocessing.current_process().pid
28-
if pid % 2 == 0:
28+
with lock:
29+
idx = process_index.value
30+
process_index.value += 1
31+
if idx % 2 == 0:
2932
for _ in range(3):
3033
with lock:
3134
success_counter.value += 1

0 commit comments

Comments
 (0)