Skip to content

Commit bf7f7b1

Browse files
authored
Fix Windows CI passing when tests fail (#953)
Co-authored-by: Krish <>
1 parent 32b30eb commit bf7f7b1

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

.builder/actions/localhost_test.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55
import time
66
import os
7-
7+
import platform
88

99
class LocalhostTest(Builder.Action):
1010

@@ -16,20 +16,24 @@ def start(self, env):
1616
if result.returncode != 0:
1717
print("Could not start a virtual environment. The localhost integration tests will fail.", file=sys.stderr)
1818
return
19-
20-
python = os.path.join(venv_path, "bin", "python")
21-
19+
20+
# Platform-specific
21+
if platform.system() == 'Windows':
22+
python = os.path.join(venv_path, "Scripts", "python.exe")
23+
else:
24+
python = os.path.join(venv_path, "bin", "python")
25+
2226
result = env.shell.exec(python, '-m', 'pip', 'install', 'h11', 'h2', 'trio')
2327
if result.returncode != 0:
2428
print("Could not install python HTTP dependencies. The localhost integration tests will fail.", file=sys.stderr)
2529
return
26-
30+
2731
server_dir = os.path.join(env.root_dir,'crt','aws-c-http','tests','mock_server')
28-
32+
2933
p1 = subprocess.Popen([python, "h2tls_mock_server.py"], cwd=server_dir)
3034
p2 = subprocess.Popen([python, "h2non_tls_server.py"], cwd=server_dir)
3135
p3 = subprocess.Popen([python, "h11mock_server.py"], cwd=server_dir)
32-
36+
3337
# Wait for servers to be ready
3438
ports = [3443, 3280, 8082, 8081]
3539
for port in ports:

src/test/java/software/amazon/awssdk/crt/test/FailFastListener.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
public class FailFastListener extends RunListener {
77
public void testFailure(Failure failure) throws Exception {
88
System.err.println("FAILURE: " + failure);
9-
System.exit(-1);
9+
// Previously we used a negative code but caused CI to pass,
10+
// for unknown reasons, even when tests failed on Windows.
11+
System.exit(1);
1012
}
1113
}

0 commit comments

Comments
 (0)