File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ function log {
6767}
6868
6969function cleanup {
70- $status = $?
70+ param (
71+ $RunExitCode
72+ )
7173
7274 $runParams = @ {
7375 NODE_NAME = $NODE_NAME
@@ -78,12 +80,12 @@ function cleanup {
7880 ./ .ci/ run- elasticsearch.ps1 @runParams
7981
8082 # Report status and exit
81- if ($status -eq 0 ) {
83+ if ($RunExitCode -eq 0 ) {
8284 log " run-tests" - Level Success
8385 exit 0
8486 } else {
8587 log " failure during run-tests" - Level Error
86- exit $status
88+ exit $RunExitCode
8789 }
8890}
8991
@@ -126,8 +128,10 @@ docker run `
126128elastic/ elasticsearch- rs `
127129cargo test $CARGO_TEST_FLAGS
128130
129- if ($LASTEXITCODE ) {
131+ $runExitCode = $LASTEXITCODE
132+
133+ if ($runExitCode -ne 0 ) {
130134 docker rm elasticsearch- rs
131135}
132136
133- cleanup
137+ cleanup $runExitCode
You can’t perform that action at this time.
0 commit comments