1
0
mirror of https://github.com/prometheus/alertmanager.git synced 2026-02-05 15:45:34 +01:00

3 Commits

Author SHA1 Message Date
Guido Trotter
8098e2275e Fix alertmanager test port allocation race conditions (#4768)
At the moment we try to allocate ports in the tests, the close them, and
then start alertmanager on those ports. This is very brittle and often
fails.

Fix the race conditions by directly starting alertmanager on
system-allocated free ports (using :0 in the address) and then detecting
the ports used, and using those in the test.

Signed-off-by: Guido Trotter <guido@hudson-trading.com>
Co-authored-by: Guido Trotter <guido@hudson-trading.com>
2025-12-02 12:10:34 -08:00
Guido Trotter
e542c68a6b MockWebhook: track shutdown status more gracefully (#4761)
* MockWebhook: track shutdown status more gracefully

When we close the server sometimes the messages are interrupted and
can't be decoded by the webhook. This change accepts any decoding
failure after server shutdown.

Signed-off-by: Guido Trotter <guido@hudson-trading.com>

* Call NewWebhook passing 't', and protect against nil cmd in Terminate

Signed-off-by: Guido Trotter <guido@hudson-trading.com>

---------

Signed-off-by: Guido Trotter <guido@hudson-trading.com>
Co-authored-by: Guido Trotter <guido@hudson-trading.com>
2025-11-21 19:01:59 +01:00
Guido Trotter
03e0782142 test/... remove duplicated code (#4752)
* Deduplicate code between test/cli and test/with_api_v2

Signed-off-by: Guido Trotter <guido@hudson-trading.com>

* Consolidate MockWebhook

Signed-off-by: Guido Trotter <guido@hudson-trading.com>

* Consolidate acceptance types and start cluster functionality

Signed-off-by: Guido Trotter <guido@hudson-trading.com>

---------

Signed-off-by: Guido Trotter <guido@hudson-trading.com>
Co-authored-by: Guido Trotter <guido@hudson-trading.com>
2025-11-21 15:07:16 +01:00