Skip to content

Commit 9c15e0f

Browse files
committed
nixosTests: re-enable 12798 edge node port check w/ promSimple
1 parent 43bc7ec commit 9c15e0f

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

nix/nixos/tests/cardano-node-artifact.nix

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
};
4040
};
4141

42+
# Only newer nixpkgs have have timeout args for all wait_for_.* fns.
43+
# Use the generic wait_until_succeeds w/ timeout arg until nixpkgs is bumped.
4244
mkScriptTest = env: ''
4345
machine.systemctl("start cardano-node-${env}")
4446
machine.wait_until_succeeds("[ -S /var/lib/cardano-node-${env}/node.socket ]", timeout=${timeout})

nix/nixos/tests/cardano-node-edge.nix

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{pkgs, ...}:
22
with pkgs; let
33
environment = "mainnet";
4+
5+
# NixosTest script fns supporting a timeout have a default of 900 seconds.
6+
timeout = toString 30;
47
in {
58
name = "cardano-node-edge-test";
69
nodes = {
@@ -45,22 +48,20 @@ in {
4548
};
4649
};
4750
};
51+
52+
# Only newer nixpkgs have have timeout args for all wait_for_.* fns.
53+
# Use the generic wait_until_succeeds w/ timeout arg until nixpkgs is bumped.
4854
testScript = ''
4955
start_all()
50-
machine.wait_for_unit("cardano-node.service")
51-
machine.wait_for_file("/run/cardano-node/node.socket")
52-
53-
# Re-enable once PrometheusSimple with node >= 10.3 is available
54-
# machine.wait_for_open_port(12798)
55-
56-
machine.wait_for_open_port(3001)
56+
machine.wait_for_unit("cardano-node.service", timeout=${timeout})
57+
machine.wait_until_succeeds("[ -S /run/cardano-node/node.socket ]", timeout=${timeout})
58+
machine.wait_until_succeeds("nc -z localhost 12798", timeout=${timeout})
59+
machine.wait_until_succeeds("nc -z localhost 3001", timeout=${timeout})
5760
machine.succeed("systemctl status cardano-node")
58-
5961
machine.succeed(
6062
"${cardanoNodePackages.cardano-cli}/bin/cardano-cli ping -h 127.0.0.1 -c 1 -q --json | ${jq}/bin/jq -c"
6163
)
62-
63-
machine.wait_for_open_port(8101)
64+
machine.wait_until_succeeds("nc -z localhost 8101", timeout=${timeout})
6465
machine.succeed("systemctl status cardano-submit-api")
6566
'';
6667
}

0 commit comments

Comments
 (0)