diff options
author | Eric Sagnes <eric.sagnes@gmail.com> | 2016-09-17 05:06:16 +0900 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2016-09-16 22:06:16 +0200 |
commit | 2d2c311304a674d1eb8fbe6c53f719d9ae51e76e (patch) | |
tree | 107771598ad74ed00992a879b2533d534d559ed2 /nixos | |
parent | 52307fd6e584a3aa4eb86fd1aba1c83b3054c9ae (diff) | |
download | nixlib-2d2c311304a674d1eb8fbe6c53f719d9ae51e76e.tar nixlib-2d2c311304a674d1eb8fbe6c53f719d9ae51e76e.tar.gz nixlib-2d2c311304a674d1eb8fbe6c53f719d9ae51e76e.tar.bz2 nixlib-2d2c311304a674d1eb8fbe6c53f719d9ae51e76e.tar.lz nixlib-2d2c311304a674d1eb8fbe6c53f719d9ae51e76e.tar.xz nixlib-2d2c311304a674d1eb8fbe6c53f719d9ae51e76e.tar.zst nixlib-2d2c311304a674d1eb8fbe6c53f719d9ae51e76e.zip |
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.
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/databases/influxdb.nix | 13 | ||||
-rw-r--r-- | nixos/modules/services/monitoring/cadvisor.nix | 1 | ||||
-rw-r--r-- | nixos/tests/cadvisor.nix | 3 | ||||
-rw-r--r-- | nixos/tests/influxdb.nix | 3 |
4 files changed, 10 insertions, 10 deletions
diff --git a/nixos/modules/services/databases/influxdb.nix b/nixos/modules/services/databases/influxdb.nix index e2268bd556ef..11ea0e1b6b41 100644 --- a/nixos/modules/services/databases/influxdb.nix +++ b/nixos/modules/services/databases/influxdb.nix @@ -66,16 +66,16 @@ let enabled = false; }]; - collectd = { + collectd = [{ enabled = false; typesdb = "${pkgs.collectd}/share/collectd/types.db"; database = "collectd_db"; port = 25826; - }; + }]; - opentsdb = { + opentsdb = [{ enabled = false; - }; + }]; continuous_queries = { enabled = true; @@ -171,6 +171,11 @@ in mkdir -m 0770 -p ${cfg.dataDir} if [ "$(id -u)" = 0 ]; then chown -R ${cfg.user}:${cfg.group} ${cfg.dataDir}; fi ''; + postStart = mkBefore '' + until ${pkgs.curl.bin}/bin/curl -s -o /dev/null 'http://127.0.0.1${toString configOptions.http.bind-address}'/ping; do + sleep 1; + done + ''; }; users.extraUsers = optional (cfg.user == "influxdb") { diff --git a/nixos/modules/services/monitoring/cadvisor.nix b/nixos/modules/services/monitoring/cadvisor.nix index a67df158be47..8ae8b12056ce 100644 --- a/nixos/modules/services/monitoring/cadvisor.nix +++ b/nixos/modules/services/monitoring/cadvisor.nix @@ -90,6 +90,7 @@ in { ${optionalString cfg.storageDriverSecure "-storage_driver_secure"} ''} ''; + TimeoutStartSec=300; }; }; diff --git a/nixos/tests/cadvisor.nix b/nixos/tests/cadvisor.nix index 3a887514773a..f0083ab18e45 100644 --- a/nixos/tests/cadvisor.nix +++ b/nixos/tests/cadvisor.nix @@ -24,9 +24,6 @@ import ./make-test.nix ({ pkgs, ... } : { $influxdb->waitForUnit("influxdb.service"); - # Wait until influxdb admin interface is available - $influxdb->waitUntilSucceeds("curl -f 127.0.0.1:8083"); - # create influxdb database $influxdb->succeed(q~ curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE root" diff --git a/nixos/tests/influxdb.nix b/nixos/tests/influxdb.nix index aca2189716a4..ee126091667a 100644 --- a/nixos/tests/influxdb.nix +++ b/nixos/tests/influxdb.nix @@ -17,9 +17,6 @@ import ./make-test.nix ({ pkgs, ...} : { $one->waitForUnit("influxdb.service"); - # Check if admin interface is avalible - $one->waitUntilSucceeds("curl -f 127.0.0.1:8083"); - # create database $one->succeed(q~ curl -XPOST http://localhost:8086/query --data-urlencode "q=CREATE DATABASE test" |