Skip to content

Commit 1ce136b

Browse files
authored
Fix main nightly CI (#2337)
* Fix nightly CI * conditionalization of signal for architecture
1 parent 91e5b3b commit 1ce136b

File tree

5 files changed

+41
-8
lines changed

5 files changed

+41
-8
lines changed

IntegrationTests/tests_02_syscall_wrappers/test_02_unacceptable_errnos.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,17 @@ for mode in debug release; do
6969
fail "exited successfully but was supposed to fail"
7070
else
7171
exit_code=$?
72-
# expecting illegal instruction as it should fail with an unacceptable errno
73-
assert_equal $(( 128 + 4 )) $exit_code # 4 == SIGILL
72+
73+
# expecting irrecoverable error as process should be terminated through fatalError/precondition/assert
74+
architecture=$(uname -m)
75+
if [[ $architecture =~ ^(arm|aarch) ]]; then
76+
assert_equal $exit_code $(( 128 + 5 )) # 5 == SIGTRAP aka trace trap, expected on ARM
77+
elif [[ $architecture =~ ^(x86|i386) ]]; then
78+
assert_equal $exit_code $(( 128 + 4 )) # 4 == SIGILL aka illegal instruction, expected on x86
79+
else
80+
fail "unknown CPU architecture for which we don't know the expected signal for a crash"
81+
fi
82+
7483
if [[ "$mode" == "debug" ]]; then
7584
grep -q unacceptable\ errno "$temp_file"
7685
fi

IntegrationTests/tests_02_syscall_wrappers/test_03_unacceptable_read_errnos.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,17 @@ for mode in debug release; do
8787
fail "exited successfully but was supposed to fail"
8888
else
8989
exit_code=$?
90-
# expecting illegal instruction as it should fail with an unacceptable errno
91-
assert_equal $(( 128 + 4 )) $exit_code # 4 == SIGILL
90+
91+
# expecting irrecoverable error as process should be terminated through fatalError/precondition/assert
92+
architecture=$(uname -m)
93+
if [[ $architecture =~ ^(arm|aarch) ]]; then
94+
assert_equal $exit_code $(( 128 + 5 )) # 5 == SIGTRAP aka trace trap, expected on ARM
95+
elif [[ $architecture =~ ^(x86|i386) ]]; then
96+
assert_equal $exit_code $(( 128 + 4 )) # 4 == SIGILL aka illegal instruction, expected on x86
97+
else
98+
fail "unknown CPU architecture for which we don't know the expected signal for a crash"
99+
fi
100+
92101
if [[ "$mode" == "debug" ]]; then
93102
grep -q unacceptable\ errno "$temp_file"
94103
fi

IntegrationTests/tests_05_assertions/test_01_syscall_wrapper_fast.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,14 @@ if "$tmp/test"; then
3838
fail "should have crashed"
3939
else
4040
exit_code=$?
41-
assert_equal $(( 128 + 4 )) $exit_code # 4 == SIGILL
41+
42+
# expecting irrecoverable error as process should be terminated through fatalError/precondition/assert
43+
architecture=$(uname -m)
44+
if [[ $architecture =~ ^(arm|aarch) ]]; then
45+
assert_equal $exit_code $(( 128 + 5 )) # 5 == SIGTRAP aka trace trap, expected on ARM
46+
elif [[ $architecture =~ ^(x86|i386) ]]; then
47+
assert_equal $exit_code $(( 128 + 4 )) # 4 == SIGILL aka illegal instruction, expected on x86
48+
else
49+
fail "unknown CPU architecture for which we don't know the expected signal for a crash"
50+
fi
4251
fi

Sources/NIOCrashTester/main.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,14 @@ func main() throws {
9898
regex: String,
9999
runResult: RunResult) throws -> InterpretedRunResult {
100100
struct NoOutputFound: Error {}
101-
102-
guard case .signal(Int(SIGILL)) = runResult else {
101+
#if arch(i386) || arch(x86_64)
102+
let expectedSignal = SIGILL
103+
#elseif arch(arm) || arch(arm64)
104+
let expectedSignal = SIGTRAP
105+
#else
106+
#error("unknown CPU architecture for which we don't know the expected signal for a crash")
107+
#endif
108+
guard case .signal(Int(expectedSignal)) = runResult else {
103109
return .unexpectedRunResult(runResult)
104110
}
105111

docker/docker-compose.2004.main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ services:
3636
- MAX_ALLOCS_ALLOWED_1000_udp_reqs=12050
3737
- MAX_ALLOCS_ALLOWED_1000_udpbootstraps=2050
3838
- MAX_ALLOCS_ALLOWED_1000_udpconnections=81050
39-
- MAX_ALLOCS_ALLOWED_1_reqs_1000_conn=405000
39+
- MAX_ALLOCS_ALLOWED_1_reqs_1000_conn=409000
4040
- MAX_ALLOCS_ALLOWED_bytebuffer_lots_of_rw=2050
4141
- MAX_ALLOCS_ALLOWED_creating_10000_headers=0
4242
- MAX_ALLOCS_ALLOWED_decode_1000_ws_frames=2050

0 commit comments

Comments
 (0)