diff options
author | Uli Baum <xeji@cat3.de> | 2018-09-04 22:39:01 +0200 |
---|---|---|
committer | Uli Baum <xeji@cat3.de> | 2018-09-04 22:46:44 +0200 |
commit | 62086c6be6560e1f34a19cb909c74a33fbc3b6c3 (patch) | |
tree | f17fbbb47b89b79ccd93d078adf33214224c615c | |
parent | 98ef33ec74c4792f14175d27241352e270d1b5d7 (diff) | |
download | nixlib-62086c6be6560e1f34a19cb909c74a33fbc3b6c3.tar nixlib-62086c6be6560e1f34a19cb909c74a33fbc3b6c3.tar.gz nixlib-62086c6be6560e1f34a19cb909c74a33fbc3b6c3.tar.bz2 nixlib-62086c6be6560e1f34a19cb909c74a33fbc3b6c3.tar.lz nixlib-62086c6be6560e1f34a19cb909c74a33fbc3b6c3.tar.xz nixlib-62086c6be6560e1f34a19cb909c74a33fbc3b6c3.tar.zst nixlib-62086c6be6560e1f34a19cb909c74a33fbc3b6c3.zip |
nixos/tests/novacomd: prevent non-deterministic failure
A sporadic failure occured on Hydra because a request was sent to the daemon after the systemd unit was started, but before the daemon was actually listening. Fix by checking for open port first.
-rw-r--r-- | nixos/tests/novacomd.nix | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos/tests/novacomd.nix b/nixos/tests/novacomd.nix index 2b56aee0a2e7..4eb60c0feb5c 100644 --- a/nixos/tests/novacomd.nix +++ b/nixos/tests/novacomd.nix @@ -9,12 +9,16 @@ import ./make-test.nix ({ pkgs, ...} : { }; testScript = '' - startAll; + $machine->waitForUnit("multi-user.target"); + # multi-user.target wants novacomd.service, but let's make sure $machine->waitForUnit("novacomd.service"); # Check status and try connecting with novacom $machine->succeed("systemctl status novacomd.service >&2"); + # to prevent non-deterministic failure, + # make sure the daemon is really listening + $machine->waitForOpenPort(6968); $machine->succeed("novacom -l"); # Stop the daemon, double-check novacom fails if daemon isn't working @@ -23,6 +27,8 @@ import ./make-test.nix ({ pkgs, ...} : { # And back again for good measure $machine->startJob("novacomd"); + # make sure the daemon is really listening + $machine->waitForOpenPort(6968); $machine->succeed("novacom -l"); ''; }) |