Skip to content

Commit

Permalink
test that clearing broadcasts works for sim tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed Mar 11, 2024
1 parent b4f4bb1 commit 370d2b6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/integration/test_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ async def test_settings_broadcast(
# The mode_settings object has been cleared:
assert itask.mode_settings is None
# Change a setting using broadcast:
schd.task_events_mgr.broadcast_mgr.put_broadcast(
schd.broadcast_mgr.put_broadcast(
['1066'], ['one'], [{
'simulation': {'fail cycle points': ''}
}])
Expand All @@ -403,10 +403,16 @@ async def test_settings_broadcast(
[itask], schd.workflow)
assert itask.mode_settings.sim_task_fails is False

# Assert Clearing the broadcast works
schd.broadcast_mgr.clear_broadcast()
schd.task_job_mgr._simulation_submit_task_jobs(
[itask], schd.workflow)
assert itask.mode_settings.sim_task_fails is True

# Assert that list of broadcasts doesn't change if we submit
# Invalid fail cycle points to broadcast.
itask.mode_settings = None
schd.task_events_mgr.broadcast_mgr.put_broadcast(
schd.broadcast_mgr.put_broadcast(
['1066'], ['one'], [{
'simulation': {'fail cycle points': 'higadfuhasgiurguj'}
}])
Expand All @@ -416,7 +422,7 @@ async def test_settings_broadcast(
'Invalid ISO 8601 date representation: higadfuhasgiurguj'
in log.messages[-1])

schd.task_events_mgr.broadcast_mgr.put_broadcast(
schd.broadcast_mgr.put_broadcast(
['1066'], ['one'], [{
'simulation': {'fail cycle points': '1'}
}])
Expand All @@ -427,7 +433,7 @@ async def test_settings_broadcast(
in log.messages[-1])

# Broadcast tasks will reparse correctly:
schd.task_events_mgr.broadcast_mgr.put_broadcast(
schd.broadcast_mgr.put_broadcast(
['1066'], ['one'], [{
'simulation': {'fail cycle points': '1945, 1977, 1066'},
'execution retry delays': '5*PT2S'
Expand Down

0 comments on commit 370d2b6

Please sign in to comment.