17
17
"""Tests for Broadcast Manager."""
18
18
19
19
20
- async def test_reject_invalid_broadcast_is_remote_clash (
20
+ async def test_reject_valid_broadcast_is_remote_clash_with_config (
21
21
one_conf , flow , start , scheduler , log_filter
22
22
):
23
23
"""`put_broadcast` gracefully rejects invalid broadcast:
@@ -39,3 +39,31 @@ async def test_reject_invalid_broadcast_is_remote_clash(
39
39
settings = [{'remote' : {'host' : 'bar' }}]
40
40
)
41
41
assert log_filter (contains = 'Cannot apply broadcast' )
42
+
43
+
44
+ async def test_reject_valid_broadcast_is_remote_clash_with_broadcast (
45
+ one_conf , flow , start , scheduler , log_filter
46
+ ):
47
+ """`put_broadcast` gracefully rejects invalid broadcast:
48
+
49
+ Existing Broadcast = [task][remote]host = foo
50
+ New Broadcast = [task]platform = bar
51
+
52
+ https://github.com/cylc/cylc-flow/pull/6711/files#r2033457964
53
+ """
54
+ schd = scheduler (flow (one_conf ))
55
+ async with start (schd ):
56
+ bc_mgr = schd .broadcast_mgr
57
+ bc_mgr .put_broadcast (
58
+ point_strings = ['1' ],
59
+ namespaces = ['one' ],
60
+ settings = [{'remote' : {'host' : 'bar' }}]
61
+ )
62
+ # this should not be allowed, if it is the scheduler will crash
63
+ # when unpaused:
64
+ bc_mgr .put_broadcast (
65
+ point_strings = ['1' ],
66
+ namespaces = ['one' ],
67
+ settings = [{'platform' : 'foo' }]
68
+ )
69
+ assert log_filter (contains = 'Cannot apply broadcast' )
0 commit comments