Skip to content

Commit 7f9e10b

Browse files
authored
Add an integration test
1 parent c5cc6c7 commit 7f9e10b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/integration/test_task_events_mgr.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
TASK_STATUS_SUBMIT_FAILED,
3737
)
3838

39+
from cylc.flow.network.resolvers import TaskMsg
40+
3941
from .test_workflow_events import TEMPLATES
4042

4143

@@ -273,6 +275,22 @@ async def test__process_message_failed_with_retry(
273275
assert 'failed/OOK' in failed_record[1]
274276

275277

278+
async def test__unhandled_message(one: Scheduler, start, log_filter):
279+
"""It should log unhandled messages."""
280+
281+
async with start(one):
282+
one.message_queue.put(
283+
TaskMsg("1/no_such_task/01", "time", 'INFO', "the quick brown")
284+
)
285+
one.process_queued_task_messages()
286+
287+
_, warning_msg = log_filter(level=logging.WARNING)[-1]
288+
assert (
289+
'Undeliverable task messages received and ignored:' in warning_msg
290+
)
291+
assert '1/no_such_task/01: INFO - "the quick brown"' in warning_msg
292+
293+
276294
@pytest.mark.parametrize('template', TEMPLATES)
277295
async def test_mail_footer_template(
278296
mod_one, # use the same scheduler for each test

0 commit comments

Comments
 (0)