File tree 2 files changed +13
-10
lines changed
2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 39
39
} ;
40
40
} ;
41
41
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.
42
44
mkScriptTest = env : ''
43
45
machine.systemctl("start cardano-node-${ env } ")
44
46
machine.wait_until_succeeds("[ -S /var/lib/cardano-node-${ env } /node.socket ]", timeout=${ timeout } )
Original file line number Diff line number Diff line change 1
1
{ pkgs , ...} :
2
2
with pkgs ; let
3
3
environment = "mainnet" ;
4
+
5
+ # NixosTest script fns supporting a timeout have a default of 900 seconds.
6
+ timeout = toString 30 ;
4
7
in {
5
8
name = "cardano-node-edge-test" ;
6
9
nodes = {
45
48
} ;
46
49
} ;
47
50
} ;
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.
48
54
testScript = ''
49
55
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 } )
57
60
machine.succeed("systemctl status cardano-node")
58
-
59
61
machine.succeed(
60
62
"${ cardanoNodePackages . cardano-cli } /bin/cardano-cli ping -h 127.0.0.1 -c 1 -q --json | ${ jq } /bin/jq -c"
61
63
)
62
-
63
- machine.wait_for_open_port(8101)
64
+ machine.wait_until_succeeds("nc -z localhost 8101", timeout=${ timeout } )
64
65
machine.succeed("systemctl status cardano-submit-api")
65
66
'' ;
66
67
}
You can’t perform that action at this time.
0 commit comments