Commit bf84763
committed
chore(test): poll for alert store expiry instead of fixed sleeps
test_monitorclient_remove_old_alerts read the alert store once at a
fixed offset after starting mender-monitor and asserted an exact key
count. mender-monitor purges expired records on a periodic loop with
variable restart latency, so the single timed read raced the purge
cycle. The faster mender_device.run() from the SSH backoff change
(no longer sleeping 1s before every healthy command) shifted the read
~2s earlier and collapsed the timing margin, surfacing the latent
flakiness (seen as '4' == '2' and '1' == '0').
Poll until the store drains to the expected count instead. It drains
monotonically (4 -> 2 -> 0), so 1s polling reliably observes each
plateau regardless of purge-loop latency.
Signed-off-by: pasinskim <marcin.pasinski@northern.tech>1 parent 11cde1b commit bf84763
1 file changed
Lines changed: 33 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1593 | 1593 | | |
1594 | 1594 | | |
1595 | 1595 | | |
1596 | | - | |
1597 | | - | |
1598 | | - | |
1599 | | - | |
1600 | | - | |
1601 | | - | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
1602 | 1624 | | |
1603 | | - | |
1604 | | - | |
1605 | | - | |
1606 | | - | |
1607 | | - | |
1608 | | - | |
1609 | | - | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
1610 | 1628 | | |
1611 | | - | |
1612 | | - | |
1613 | | - | |
1614 | | - | |
1615 | | - | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
| 1629 | + | |
| 1630 | + | |
1620 | 1631 | | |
1621 | 1632 | | |
1622 | 1633 | | |
| |||
0 commit comments