Skip to content

Commit 23738ac

Browse files
committed
fix: improve flaky distribution tests
1 parent 1b75e15 commit 23738ac

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

indexify/tests/cli/test_function_allowlist.py

+5
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ def function_dev(_: str) -> int:
8484

8585
class TestFunctionAllowlist(unittest.TestCase):
8686
def test_function_routing(self):
87+
print(
88+
"Waiting for 30 seconds for Server to notice that any previously existing Executors exited."
89+
)
90+
time.sleep(30)
91+
8792
graph_name = test_graph_name(self)
8893
version = str(time.time())
8994

indexify/tests/cli/test_server_task_distribution.py

+13
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ def success_func(sleep_secs: float) -> str:
3030

3131
class TestServerTaskDistribution(unittest.TestCase):
3232
def test_server_distributes_invocations_fairly_between_two_executors(self):
33+
print(
34+
"Waiting for 30 seconds for Server to notice that any previously existing Executors exited."
35+
)
36+
time.sleep(30)
37+
3338
graph_name = test_graph_name(self)
3439
version = str(time.time())
3540

@@ -81,6 +86,10 @@ def test_server_distributes_invocations_fairly_between_two_executors(self):
8186
self.assertLess(invocations_count, 125)
8287

8388
def test_server_redistributes_invocations_when_new_executor_joins(self):
89+
print(
90+
"Waiting for 30 seconds for Server to notice that any previously existing Executors exited."
91+
)
92+
time.sleep(30)
8493
graph_name = test_graph_name(self)
8594
version = str(time.time())
8695

@@ -132,6 +141,10 @@ def test_server_redistributes_invocations_when_new_executor_joins(self):
132141
self.assertLess(invocations_count, 150)
133142

134143
def test_all_tasks_succeed_when_executor_exits(self):
144+
print(
145+
"Waiting for 30 seconds for Server to notice that any previously existing Executors exited."
146+
)
147+
time.sleep(30)
135148
graph_name = test_graph_name(self)
136149
version = str(time.time())
137150

0 commit comments

Comments
 (0)