mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
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.
This commit is contained in:
parent
98ef33ec74
commit
62086c6be6
@ -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");
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user