Skip to content

Commit 709cbd2

Browse files
authored
Merge pull request #616 from opsmill/pog-event-test
Update flaky event test
2 parents a455066 + 592ee28 commit 709cbd2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/integration/test_infrahub_client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,13 @@ async def test_task_query(self, client: InfrahubClient, base_dataset, set_pagina
187187
# Query Tasks using Parallel mode
188188
tasks_parallel = await client.task.filter(filter=TaskFilter(state=[TaskState.COMPLETED]), parallel=True)
189189
assert tasks_parallel
190-
assert len(tasks_parallel) == len(tasks)
190+
task_parallel_ids = [task.id for task in tasks_parallel]
191+
192+
# Additional tasks might have been completed between the two queries
193+
# validate that we get at least as many tasks as in the first query
194+
# and that all task IDs from the first query are present in the second one
195+
assert len(tasks_parallel) >= len(tasks)
196+
assert set(task_ids).issubset(set(task_parallel_ids))
191197

192198
# Query Tasks by ID
193199
tasks_parallel_filtered = await client.task.filter(filter=TaskFilter(ids=task_ids[:2]), parallel=True)

0 commit comments

Comments
 (0)