Skip to content

Commit

Permalink
Run container_down test after monit config change (sonic-net#10126)
Browse files Browse the repository at this point in the history
## Description of PR

Summary:
Fixes # (issue)

### Type of change

- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] Test case(new/improvement)


## Approach
#### What is the motivation for this PR?

event-down-ctr test is flaky because we run the test before monit changes are in place which means start delay for monit is at 5 minutes, so container_checker will not catch event.

#### How did you do it?

Move test after monit config is changed

#### How did you verify/test it?

Manual/pipeline
  • Loading branch information
zbud-msft authored and AharonMalkin committed Jan 25, 2024
1 parent f74ef05 commit 06579a0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/telemetry/events/host_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ def test_event(duthost, gnxi_path, ptfhost, data_dir, validate_yang):
logger.info("Beginning to test host events")
run_test(duthost, gnxi_path, ptfhost, data_dir, validate_yang, trigger_kernel_event,
"event_kernel.json", "sonic-events-host:event-kernel", tag, False)
run_test(duthost, gnxi_path, ptfhost, data_dir, validate_yang, restart_container,
"event_stopped_ctr.json", "sonic-events-host:event-stopped-ctr", tag, False)
run_test(duthost, gnxi_path, ptfhost, data_dir, validate_yang, mask_container,
"event_down_ctr.json", "sonic-events-host:event-down-ctr", tag, False)

backup_monit_config(duthost)
customize_monit_config(
duthost,
Expand All @@ -37,6 +32,10 @@ def test_event(duthost, gnxi_path, ptfhost, data_dir, validate_yang):
"cpu_usage.json", "sonic-events-host:cpu-usage", tag, False)
run_test(duthost, gnxi_path, ptfhost, data_dir, validate_yang, trigger_mem_threshold_exceeded_alert,
"mem_threshold_exceeded.json", "sonic-events-host:mem-threshold-exceeded", tag)
run_test(duthost, gnxi_path, ptfhost, data_dir, validate_yang, restart_container,
"event_stopped_ctr.json", "sonic-events-host:event-stopped-ctr", tag, False)
run_test(duthost, gnxi_path, ptfhost, data_dir, validate_yang, mask_container,
"event_down_ctr.json", "sonic-events-host:event-down-ctr", tag, False)
finally:
restore_monit_config(duthost)

Expand Down

0 comments on commit 06579a0

Please sign in to comment.