Fix main nightly CI (#2337)

* Fix nightly CI

* conditionalization of signal for architecture
This commit is contained in:
David Nadoba 2023-01-09 19:34:48 +01:00 committed by GitHub
parent 91e5b3b609
commit 1ce136b4c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 8 deletions

View File

@ -69,8 +69,17 @@ for mode in debug release; do
fail "exited successfully but was supposed to fail"
else
exit_code=$?
# expecting illegal instruction as it should fail with an unacceptable errno
assert_equal $(( 128 + 4 )) $exit_code # 4 == SIGILL
# expecting irrecoverable error as process should be terminated through fatalError/precondition/assert
architecture=$(uname -m)
if [[ $architecture =~ ^(arm|aarch) ]]; then
assert_equal $exit_code $(( 128 + 5 )) # 5 == SIGTRAP aka trace trap, expected on ARM
elif [[ $architecture =~ ^(x86|i386) ]]; then
assert_equal $exit_code $(( 128 + 4 )) # 4 == SIGILL aka illegal instruction, expected on x86
else
fail "unknown CPU architecture for which we don't know the expected signal for a crash"
fi
if [[ "$mode" == "debug" ]]; then
grep -q unacceptable\ errno "$temp_file"
fi

View File

@ -87,8 +87,17 @@ for mode in debug release; do
fail "exited successfully but was supposed to fail"
else
exit_code=$?
# expecting illegal instruction as it should fail with an unacceptable errno
assert_equal $(( 128 + 4 )) $exit_code # 4 == SIGILL
# expecting irrecoverable error as process should be terminated through fatalError/precondition/assert
architecture=$(uname -m)
if [[ $architecture =~ ^(arm|aarch) ]]; then
assert_equal $exit_code $(( 128 + 5 )) # 5 == SIGTRAP aka trace trap, expected on ARM
elif [[ $architecture =~ ^(x86|i386) ]]; then
assert_equal $exit_code $(( 128 + 4 )) # 4 == SIGILL aka illegal instruction, expected on x86
else
fail "unknown CPU architecture for which we don't know the expected signal for a crash"
fi
if [[ "$mode" == "debug" ]]; then
grep -q unacceptable\ errno "$temp_file"
fi

View File

@ -38,5 +38,14 @@ if "$tmp/test"; then
fail "should have crashed"
else
exit_code=$?
assert_equal $(( 128 + 4 )) $exit_code # 4 == SIGILL
# expecting irrecoverable error as process should be terminated through fatalError/precondition/assert
architecture=$(uname -m)
if [[ $architecture =~ ^(arm|aarch) ]]; then
assert_equal $exit_code $(( 128 + 5 )) # 5 == SIGTRAP aka trace trap, expected on ARM
elif [[ $architecture =~ ^(x86|i386) ]]; then
assert_equal $exit_code $(( 128 + 4 )) # 4 == SIGILL aka illegal instruction, expected on x86
else
fail "unknown CPU architecture for which we don't know the expected signal for a crash"
fi
fi

View File

@ -98,8 +98,14 @@ func main() throws {
regex: String,
runResult: RunResult) throws -> InterpretedRunResult {
struct NoOutputFound: Error {}
guard case .signal(Int(SIGILL)) = runResult else {
#if arch(i386) || arch(x86_64)
let expectedSignal = SIGILL
#elseif arch(arm) || arch(arm64)
let expectedSignal = SIGTRAP
#else
#error("unknown CPU architecture for which we don't know the expected signal for a crash")
#endif
guard case .signal(Int(expectedSignal)) = runResult else {
return .unexpectedRunResult(runResult)
}

View File

@ -36,7 +36,7 @@ services:
- MAX_ALLOCS_ALLOWED_1000_udp_reqs=12050
- MAX_ALLOCS_ALLOWED_1000_udpbootstraps=2050
- MAX_ALLOCS_ALLOWED_1000_udpconnections=81050
- MAX_ALLOCS_ALLOWED_1_reqs_1000_conn=405000
- MAX_ALLOCS_ALLOWED_1_reqs_1000_conn=409000
- MAX_ALLOCS_ALLOWED_bytebuffer_lots_of_rw=2050
- MAX_ALLOCS_ALLOWED_creating_10000_headers=0
- MAX_ALLOCS_ALLOWED_decode_1000_ws_frames=2050