Skip to content

Commit

Permalink
Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Matvey-Kuk committed Jan 7, 2025
1 parent b53d22e commit 7c95b27
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tests/test_workflow_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ async def test_workflow_execution(
)
create_alert("fp1", alert_status, base_time - timedelta(minutes=time_diff))

# await asyncio.sleep(1)

# Create the current alert
current_alert = AlertDto(
id="grafana-1",
Expand Down Expand Up @@ -447,11 +445,10 @@ async def test_workflow_execution_2(
fingerprint="fp1",
)

await workflow_manager.start()

# Insert the current alert into the workflow manager
await workflow_manager.insert_events(SINGLE_TENANT_UUID, [current_alert])
assert len(workflow_manager.scheduler.workflows_to_run) == 1

await workflow_manager.start()

# Wait for the workflow execution to complete
workflow_execution = None
Expand All @@ -468,7 +465,7 @@ async def test_workflow_execution_2(
)
if workflow_execution is not None:
status = workflow_execution.status
await asyncio.sleep(1)
await asyncio.sleep(0.1)
count += 1

await workflow_manager.stop()
Expand Down Expand Up @@ -596,7 +593,7 @@ async def test_workflow_execution_3(
)
if workflow_execution is not None:
status = workflow_execution.status
await asyncio.sleep(1)
await asyncio.sleep(0.1)
count += 1

await workflow_manager.stop()
Expand Down Expand Up @@ -1300,6 +1297,7 @@ async def test_alert_routing_policy(
)

await workflow_manager.start()
await asyncio.sleep(1)
# Insert the alert into workflow manager
await workflow_manager.insert_events(SINGLE_TENANT_UUID, [current_alert])

Expand All @@ -1315,7 +1313,7 @@ async def test_alert_routing_policy(
)
if workflow_execution is not None and workflow_execution.status == "success":
found = True
await asyncio.sleep(1)
await asyncio.sleep(0.1)
count += 1

# Verify workflow execution
Expand Down

0 comments on commit 7c95b27

Please sign in to comment.