Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/cores/mega/test_aio.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def tearDown(self):
self.process3.terminate()

async def test_schedule(self):
t = time.time()
t = time.monotonic()
task1 = asyncio.create_task(self.service_builder.schedule(initial_inputs={"text": "hello, "}))
task2 = asyncio.create_task(self.service_builder.schedule(initial_inputs={"text": "hi, "}))
await asyncio.gather(task1, task2)
Expand All @@ -93,7 +93,7 @@ async def test_schedule(self):
self.assertEqual(result_dict2[self.s2.name]["text"], "hi, opea project1!")
self.assertEqual(result_dict2[self.s3.name]["text"], "hi, opea project2!")
self.assertEqual(len(self.service_builder.get_all_final_outputs(result_dict1, runtime_graph1).keys()), 2)
self.assertEqual(int(time.time() - t), 15)
self.assertEqual(int(time.monotonic() - t), 15)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion tests/cores/mega/test_service_orchestrator_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_extract_chunk_str(self):
self.assertEqual(res, "example test.")

def test_token_generator(self):
start = time.time()
start = time.monotonic()
sentence = "I write an example test.</s>"
for i in self.service_builder.token_generator(
sentence=sentence, token_start=start, is_first=True, is_last=False
Expand Down