Skip to content

Commit

Permalink
Fix async test (opea-project#60)
Browse files Browse the repository at this point in the history
* fix async test

Signed-off-by: Spycsh <[email protected]>

* fix yaml orchestrator

---------

Signed-off-by: Spycsh <[email protected]>
  • Loading branch information
Spycsh authored May 16, 2024
1 parent 9ddc8ec commit ba20162
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion comps/cores/mega/orchestrator_with_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def process_outputs(self, prev_nodes: List) -> Dict:
all_outputs.update(self.result_dict[prev_node])
return all_outputs

def schedule(self, initial_inputs: Dict):
async def schedule(self, initial_inputs: Dict):
for node in self.topological_sort():
if node in self.ind_nodes():
inputs = initial_inputs
Expand Down
2 changes: 1 addition & 1 deletion tests/cores/mega/test_service_orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def s2_add(request: TextDoc) -> TextDoc:
return {"text": text}


class TestServiceOrchestrator(unittest.TestCase):
class TestServiceOrchestrator(unittest.IsolatedAsyncioTestCase):
def setUp(self):
self.s1 = opea_microservices["s1"]
self.s2 = opea_microservices["s2"]
Expand Down
2 changes: 1 addition & 1 deletion tests/cores/mega/test_service_orchestrator_with_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def s2_add(request: TextDoc) -> TextDoc:
return {"text": text}


class TestServiceOrchestrator(unittest.TestCase):
class TestServiceOrchestrator(unittest.IsolatedAsyncioTestCase):
def setUp(self):
self.s1 = opea_microservices["s1"]
self.s2 = opea_microservices["s2"]
Expand Down
2 changes: 1 addition & 1 deletion tests/cores/mega/test_service_orchestrator_with_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def s2_add(request: TextDoc) -> TextDoc:
return {"text": text}


class TestYAMLOrchestrator(unittest.TestCase):
class TestYAMLOrchestrator(unittest.IsolatedAsyncioTestCase):
def setUp(self) -> None:
self.s1 = opea_microservices["s1"]
self.s2 = opea_microservices["s2"]
Expand Down

0 comments on commit ba20162

Please sign in to comment.