nixos/tests/prometheus: wait for influxdb exporter before quering

Previously the influxdb exporter test was flaky as even after the
service has started there is still a race before the service is actually
listening and accepting connection on port 9122.

With this commit the test will wait for the port to be open before
proceeding.
This commit is contained in:
Andreas Rammhold 2021-08-27 14:09:35 +02:00
parent 72197a5c79
commit 92442b1f99
No known key found for this signature in database
GPG key ID: E432E410B5E48C86

View file

@ -280,6 +280,7 @@ let
};
exporterTest = ''
wait_for_unit("prometheus-influxdb-exporter.service")
wait_for_open_port(9122)
succeed(
"curl -XPOST http://localhost:9122/write --data-binary 'influxdb_exporter,distro=nixos,added_in=21.09 value=1'"
)