Skip to content

Commit d448656

Browse files
committed
Introduce short sleep to fix random errors
1 parent 2a940dd commit d448656

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

daliuge-engine/test/test_drop.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import base64
2424
import contextlib
2525
import io
26+
import time
2627
import os, unittest
2728
import pickle
2829
import random
@@ -45,7 +46,7 @@
4546
from dlg.data.drops.file import FileDROP
4647
from dlg.droputils import DROPWaiterCtx
4748
from dlg.exceptions import InvalidDropException
48-
from dlg.apps.simple import SimpleBranch
49+
from dlg.apps.simple import Branch
4950
from dlg.apps.simple import NullBarrierApp, SleepAndCopyApp
5051

5152
try:
@@ -1168,7 +1169,7 @@ class BranchAppDropTestsBase(object):
11681169
"""Tests for the Branch class"""
11691170

11701171
def _simple_branch_with_outputs(self, result, uids):
1171-
a = SimpleBranch(uids[0], uids[0], result=result, func_name="test.test_drop.func1")
1172+
a = Branch(uids[0], uids[0], result=result, func_name="test.test_drop.func1")
11721173
b, c = (self.DataDropType(x, x) for x in uids[1:])
11731174
a.addOutput(b)
11741175
a.addOutput(c)
@@ -1231,7 +1232,7 @@ def _test_single_branch_graph(self, result, levels):
12311232
[DROPStates.COMPLETED, DROPStates.SKIPPED],
12321233
):
12331234
a.async_execute()
1234-
1235+
time.sleep(0.01)
12351236
# Depending on "result", the "true" branch will be run or skipped
12361237
self._assert_drop_complete_or_skipped(last_true, result)
12371238
self._assert_drop_complete_or_skipped(last_false, not result)

0 commit comments

Comments
 (0)