Revert #31: open link-down alerts from a monitor glitch were revived and ticketed
Lint / JS (eslint) (push) Successful in 12s
Lint / Python (flake8) (push) Successful in 1m47s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 1m15s
Lint / JS (eslint) (pull_request) Successful in 7s
Lint / Python (flake8) (pull_request) Successful in 48s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Test / Python Tests (pytest) (push) Successful in 1m41s
Security / Python Security (bandit) (pull_request) Successful in 1m32s
Test / Python Tests (pytest) (pull_request) Successful in 1m6s
Lint / JS (eslint) (push) Successful in 12s
Lint / Python (flake8) (push) Successful in 1m47s
Lint / Notify on failure (push) Skipped
Lint / Deploy (push) Skipped
Security / Python Security (bandit) (push) Successful in 1m15s
Lint / JS (eslint) (pull_request) Successful in 7s
Lint / Python (flake8) (pull_request) Successful in 48s
Lint / Notify on failure (pull_request) Skipped
Lint / Deploy (pull_request) Skipped
Test / Python Tests (pytest) (push) Successful in 1m41s
Security / Python Security (bandit) (pull_request) Successful in 1m32s
Test / Python Tests (pytest) (pull_request) Successful in 1m6s
#31 treated any open interface_down alert as previously up. Production had six such alerts all created in the same second on 2026-03-02 (a monitor glitch, on ports that were never in use: large1 enp36s0 and a USB adapter, compute-storage-01 nic1-3, micro1 enp3s0). Reviving them opened per-host tickets and a P1 cluster-wide ticket. Back to the previous behaviour while a safer fix is worked out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,6 @@ def db():
|
||||
mock_db.cutsheet_load.return_value = {'items': [], 'cables': [], 'port_labels': []}
|
||||
mock_db.get_pending_recovery_notes.return_value = []
|
||||
mock_db.get_device_link.return_value = ''
|
||||
mock_db.get_open_event_targets.return_value = []
|
||||
yield mock_db
|
||||
|
||||
|
||||
@@ -118,24 +117,6 @@ class TestDeadHostDetection:
|
||||
mon._process_interfaces({HOST_A: {'eth0': True}}, [])
|
||||
assert ('cluster_network_issue', 'test-cluster', '') in upserted(db)
|
||||
|
||||
def test_open_alert_survives_a_baseline_reset(self, mon, db):
|
||||
# The baseline lost eth1 (reset), but its link-down alert is still open: keep alerting
|
||||
db.get_open_event_targets.return_value = [('alpha', 'eth1')]
|
||||
db.upsert_event.return_value = (3, False, 2, None)
|
||||
mon._process_interfaces({HOST_A: {'eth0': True, 'eth1': False}, HOST_B: {'eth0': True}}, [])
|
||||
assert ('interface_down', 'alpha', 'eth1') in upserted(db)
|
||||
assert 'Interface eth1 link-down' in mon.tickets.create.call_args.args[0]
|
||||
|
||||
def test_open_alert_resolves_when_the_link_returns(self, mon, db):
|
||||
db.get_open_event_targets.return_value = [('alpha', 'eth1')]
|
||||
mon._process_interfaces({HOST_A: {'eth0': True, 'eth1': True}, HOST_B: {'eth0': True}}, [])
|
||||
db.resolve_event.assert_any_call('interface_down', 'alpha', 'eth1')
|
||||
|
||||
def test_first_seen_down_without_an_alert_still_stays_quiet(self, mon, db):
|
||||
db.get_open_event_targets.return_value = []
|
||||
mon._process_interfaces({HOST_A: {'eth0': True, 'eth1': False}, HOST_B: {'eth0': True}}, [])
|
||||
assert ('interface_down', 'alpha', 'eth1') not in upserted(db)
|
||||
|
||||
def test_dead_host_shows_as_down_on_dashboard(self, mon):
|
||||
snap = mon._collect_snapshot({HOST_A: {'eth0': True}})
|
||||
assert snap['hosts']['alpha']['status'] == 'up'
|
||||
|
||||
Reference in New Issue
Block a user