Skip to content

Commit

Permalink
swap out load beacon for status beacon which is a bit more predictabl…
Browse files Browse the repository at this point in the history
…e when it will fire.
  • Loading branch information
garethgreenaway authored and Megan Wilhite committed Oct 18, 2023
1 parent 21a2898 commit bc7c3f3
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions tests/pytests/integration/modules/test_pillar.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,9 @@ def test_pillar_refresh_pillar_beacons(
event_listerner_timeout,
):
"""
Ensure beacons jobs in pillar are only updated when values change.
Ensure beacons jobs in pillar are started after
a pillar refresh and then not running when pillar
is cleared.
"""

top_sls = """
Expand All @@ -629,23 +631,9 @@ def test_pillar_refresh_pillar_beacons(

test_beacons_sls = """
beacons:
load:
- averages:
1m:
- 0.0
- 5.0
5m:
- 0.0
- 5.0
15m:
- 0.0
- 5.0
- emitatstartup: True
- onchangeonly: False
"""

test_beacons_sls2 = """
beacons: {}
status:
- loadavg:
- 1-min
"""

assert salt_minion.is_running()
Expand Down Expand Up @@ -673,7 +661,7 @@ def test_pillar_refresh_pillar_beacons(
# Give the beacons a chance to start
time.sleep(5)

event_tag = f"salt/beacon/*/load/"
event_tag = f"salt/beacon/*/status/*"
start_time = time.time()

event_pattern = (salt_master.id, event_tag)
Expand All @@ -697,14 +685,14 @@ def test_pillar_refresh_pillar_beacons(
# Give the beacons a chance to stop
time.sleep(5)

event_tag = f"salt/beacon/*/load/"
event_tag = f"salt/beacon/*/status/*"
start_time = time.time()

event_pattern = (salt_master.id, event_tag)
matched_events = event_listener.wait_for_events(
[event_pattern],
after_time=start_time,
timeout=event_listerner_timeout.catch,
timeout=event_listerner_timeout.miss,
)

assert not matched_events.found_all_events

0 comments on commit bc7c3f3

Please sign in to comment.