[action] [PR:27355] [process_monitoring] Skip auto-restart processes (bmcweb/sonic-dbus-bridge) from expected alerts on BMC - #1384
Merged
Conversation
…ridge) from expected alerts on BMC
### Description of PR
Summary:
Fixes #27354
`test_monitoring_critical_processes` fails on BMC platforms. The test kills the `redfish` container's critical processes (`bmcweb`, `sonic-dbus-bridge`) and expects a `Process '<name>' is not running` alert in syslog. But both are configured with `autorestart=true` in their container's `supervisord.conf`, so supervisord restarts them immediately after they are killed — they never stay down long enough for `supervisor-proc-exit-listener` to emit the alert. LogAnalyzer then reports them as missing (`expected_missing_match: 2`).
The `otel` process already had the same problem and was handled with a hardcoded skip; this PR generalizes that handling.
### Type of change
- [x] Bug fix
- [ ] Testbed and Framework(new/improvement)
- [ ] New Test case
- [ ] Skipped for non-supported platforms
- [ ] Test case improvement
### Back port request
- [ ] 202205
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505
- [ ] 202511
- [x] 202608
### Approach
#### What is the motivation for this PR?
Make `test_monitoring_critical_processes` pass on BMC platforms, where `bmcweb` and `sonic-dbus-bridge` auto-restart and therefore never emit "not running" syslog alerts.
#### How did you do it?
Added a static `AUTORESTART_CRITICAL_PROCESSES` map (keyed by container name: `otel` → `otel`; `redfish` → `bmcweb`, `sonic-dbus-bridge`) and a `_is_autorestart_process()` helper (tolerates a namespace/ASIC suffix). In `get_expected_alerting_messages_supervisor`, these processes are skipped from the expected alerting messages, in both the process and group loops. This folds the previously hardcoded `otel` skip into the same list. The processes are still killed, so the kill/restart path is still exercised.
#### How did you verify/test it?
- `python -m py_compile` and `flake8 --max-line-length=120` pass on the modified file.
- Root cause confirmed in sonic-buildimage: `bmcweb`, `sonic-dbus-bridge`, and `otel` all set `autorestart=true`; alerting processes `lldpd`/`lldpmgrd` set `autorestart=false`.
#### Any platform specific information?
The `redfish` container (bmcweb, sonic-dbus-bridge) only exists on BMC platforms.
#### Supported testbed topology if it's a new test case?
N/A — existing test, `bmc`/`any` topology.
### Documentation
N/A
Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
Collaborator
Author
|
Original PR: sonic-net/sonic-mgmt#27355 |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
Author
|
/azp run |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Fixes #27354
test_monitoring_critical_processesfails on BMC platforms. The test kills theredfishcontainer's critical processes (bmcweb,sonic-dbus-bridge) and expects aProcess '<name>' is not runningalert in syslog. But both are configured withautorestart=truein their container'ssupervisord.conf, so supervisord restarts them immediately after they are killed — they never stay down long enough forsupervisor-proc-exit-listenerto emit the alert. LogAnalyzer then reports them as missing (expected_missing_match: 2).The
otelprocess already had the same problem and was handled with a hardcoded skip; this PR generalizes that handling.Type of change
Back port request
Approach
What is the motivation for this PR?
Make
test_monitoring_critical_processespass on BMC platforms, wherebmcwebandsonic-dbus-bridgeauto-restart and therefore never emit "not running" syslog alerts.How did you do it?
Added a static
AUTORESTART_CRITICAL_PROCESSESmap (keyed by container name:otel→otel;redfish→bmcweb,sonic-dbus-bridge) and a_is_autorestart_process()helper (tolerates a namespace/ASIC suffix). Inget_expected_alerting_messages_supervisor, these processes are skipped from the expected alerting messages, in both the process and group loops. This folds the previously hardcodedotelskip into the same list. The processes are still killed, so the kill/restart path is still exercised.How did you verify/test it?
python -m py_compileandflake8 --max-line-length=120pass on the modified file.bmcweb,sonic-dbus-bridge, andotelall setautorestart=true; alerting processeslldpd/lldpmgrdsetautorestart=false.Any platform specific information?
The
redfishcontainer (bmcweb, sonic-dbus-bridge) only exists on BMC platforms.Supported testbed topology if it's a new test case?
N/A — existing test,
bmc/anytopology.Documentation
N/A
Signed-off-by: Sonic Build Admin sonicbld@microsoft.com