From 65234f091107959952095e2e45f5a4dd1d087004 Mon Sep 17 00:00:00 2001
From: Martin Weinelt <hexa@darmstadt.ccc.de>
Date: Thu, 15 Apr 2021 03:18:07 +0200
Subject: [PATCH] nixos/test/prometheus-exporters/bird: fix race condition
The bird socket would not always be instantly present, when the exporter
was queried, leading to the test sometimes failing in its entirety.
---
nixos/tests/prometheus-exporters.nix | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix
index 62c0080dd51..cf3518286fd 100644
--- a/nixos/tests/prometheus-exporters.nix
+++ b/nixos/tests/prometheus-exporters.nix
@@ -132,7 +132,9 @@ let
exporterTest = ''
wait_for_unit("prometheus-bird-exporter.service")
wait_for_open_port(9324)
- succeed("curl -sSf http://localhost:9324/metrics | grep -q 'MyObviousTestString'")
+ wait_until_succeeds(
+ "curl -sSf http://localhost:9324/metrics | grep -q 'MyObviousTestString'"
+ )
'';
};