diff options
author | Tuomas Tynkkynen <tuomas@tuxera.com> | 2017-04-02 02:21:59 +0300 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas@tuxera.com> | 2017-04-02 02:33:21 +0300 |
commit | affce1e2464f226afb6902c5185fee80d847d857 (patch) | |
tree | 4cf832996d0f288e34b8fb4bdbb9868741a40433 /nixos/tests/hibernate.nix | |
parent | 40d171855f7155df1a597184d7c61642eb48093e (diff) |
nixos hibernate test: Use waitForOpenPort
There was one confusing recent failure of this:
http://cache.nixos.org/log/myla8bc17j8spmifdxmrz9jswxwsf5w6-vm-test-run-hibernate.drv
I don't have any real ideas on what could cause the problem but there is
at least one theoretical one: the system starts hibernating before the
listener process manages to open the TCP port for listening, and it can't
open it after resuming because not enough pages from the netcat binary
have been paged in (and as the 9p filesystem holding it is now toast,
they can't be loaded anymore).
Diffstat (limited to 'nixos/tests/hibernate.nix')
-rw-r--r-- | nixos/tests/hibernate.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/tests/hibernate.nix b/nixos/tests/hibernate.nix index 7616a75b0214..db58a2f5c857 100644 --- a/nixos/tests/hibernate.nix +++ b/nixos/tests/hibernate.nix @@ -13,7 +13,7 @@ import ./make-test.nix (pkgs: { networking.firewall.allowedTCPPorts = [ 4444 ]; - systemd.services.listener.serviceConfig.ExecStart = "${pkgs.netcat}/bin/nc -l 4444"; + systemd.services.listener.serviceConfig.ExecStart = "${pkgs.netcat}/bin/nc -l 4444 -k"; }; probe = { config, lib, pkgs, ...}: { @@ -32,6 +32,7 @@ import ./make-test.nix (pkgs: { $machine->succeed("mkswap /dev/vdb"); $machine->succeed("swapon -a"); $machine->startJob("listener"); + $machine->waitForOpenPort(4444); $machine->succeed("systemctl hibernate &"); $machine->waitForShutdown; $machine->start; |