Skip to content

Commit

Permalink
nixos hibernate test: Use waitForOpenPort
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
dezgeg committed Apr 1, 2017
1 parent 40d1718 commit affce1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nixos/tests/hibernate.nix
Expand Up @@ -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, ...}: {
Expand All @@ -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;
Expand Down

0 comments on commit affce1e

Please sign in to comment.