cadvisor test: fix (#18671)
* influxdb module: add postStart
* cadvisor module: increase TimeoutStartSec
Under high load, the cadvisor module can take longer than the default 90
seconds to start. This change should hopefully fix the test on Hydra.
commit2d2c311304a674d1eb8fbe6c53f719d9ae51e76e
authorEric Sagnes <eric.sagnes@gmail.com>
dateSat 17 Sep 2016, 05:06 (10 years ago)
parent52307fd
nixos/modules/services/databases/influxdb.nix+9−4
@@ -66,16 +66,16 @@ let
6666 enabled = false;
6767 }];
6868
69− collectd = {
69+ collectd = [{
7070 enabled = false;
7171 typesdb = "${pkgs.collectd}/share/collectd/types.db";
7272 database = "collectd_db";
7373 port = 25826;
74− };
74+ }];
7575
76− opentsdb = {
76+ opentsdb = [{
7777 enabled = false;
78− };
78+ }];
7979
8080 continuous_queries = {
8181 enabled = true;
@@ -171,6 +171,11 @@ in
171171 mkdir -m 0770 -p ${cfg.dataDir}
172172 if [ "$(id -u)" = 0 ]; then chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}; fi
173173 '';
174+ postStart = mkBefore ''
175+ until ${pkgs.curl.bin}/bin/curl -s -o /dev/null 'http://127.0.0.1${toString configOptions.http.bind-address}'/ping; do
176+ sleep 1;
177+ done
178+ '';
174179 };
175180
176181 users.extraUsers = optional (cfg.user == "influxdb") {
nixos/modules/services/monitoring/cadvisor.nix+1
@@ -90,6 +90,7 @@ in {
9090 ${optionalString cfg.storageDriverSecure "-storage_driver_secure"}
9191 ''}
9292 '';
93+ TimeoutStartSec=300;
9394 };
9495 };
9596
nixos/tests/cadvisor.nix−3
@@ -24,9 +24,6 @@ import ./make-test.nix ({ pkgs, ... } : {
2424
2525 $influxdb->waitForUnit("influxdb.service");
2626
27− # Wait until influxdb admin interface is available
28− $influxdb->waitUntilSucceeds("curl -f 127.0.0.1:8083");
29−
3027 # create influxdb database
3128 $influxdb->succeed(q~
3229 curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root"
nixos/tests/influxdb.nix−3
@@ -17,9 +17,6 @@ import ./make-test.nix ({ pkgs, ...} : {
1717
1818 $one->waitForUnit("influxdb.service");
1919
20− # Check if admin interface is avalible
21− $one->waitUntilSucceeds("curl -f 127.0.0.1:8083");
22−
2320 # create database
2421 $one->succeed(q~
2522 curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE test"