Merge pull request #233247 from teutat3s/zhf/fix-prometheus-exporter-statsd

nixosTests.prometheus-exporters.statsd fix test
This commit is contained in:
Martin Weinelt 2023-05-21 17:47:07 +02:00 committed by GitHub
commit 84229fb9cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1198,13 +1198,15 @@ let
wait_for_unit("prometheus-statsd-exporter.service")
wait_for_open_port(9102)
succeed("curl http://localhost:9102/metrics | grep 'statsd_exporter_build_info{'")
succeed(
"echo 'test.udp:1|c' > /dev/udp/localhost/9125",
"curl http://localhost:9102/metrics | grep 'test_udp 1'",
wait_until_succeeds(
"echo 'test.udp:1|c' > /dev/udp/localhost/9125 && \
curl http://localhost:9102/metrics | grep 'test_udp 1'",
timeout=10
)
succeed(
"echo 'test.tcp:1|c' > /dev/tcp/localhost/9125",
"curl http://localhost:9102/metrics | grep 'test_tcp 1'",
wait_until_succeeds(
"echo 'test.tcp:1|c' > /dev/tcp/localhost/9125 && \
curl http://localhost:9102/metrics | grep 'test_tcp 1'",
timeout=10
)
'';
};