Skip to content

Commit f1a9b2e

Browse files
authored
Merge pull request #85297 from kavon/xfail-unit-test-rdar163604876
unittests: skip some tests on AL2
2 parents 2504bee + c06c72a commit f1a9b2e

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

unittests/runtime/Actor.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ TEST(ActorTest, actorSwitch) {
318318
}
319319

320320
TEST(ActorTest, actorContention) {
321+
#ifdef __SKIP_RDAR163604876__
322+
GTEST_SKIP() << "Skipping due to rdar://163604876";
323+
#endif
321324
run([] {
322325
using Context = TupleContext<AsyncTask*, TestActor*>;
323326
auto actor = createActor();
@@ -387,6 +390,9 @@ TEST(ActorTest, actorContention) {
387390
}
388391

389392
TEST(ActorTest, actorPriority) {
393+
#ifdef __SKIP_RDAR163604876__
394+
GTEST_SKIP() << "Skipping due to rdar://163604876";
395+
#endif
390396
run([] {
391397
auto actor = createActor();
392398

@@ -430,6 +436,9 @@ TEST(ActorTest, actorPriority) {
430436
}
431437

432438
TEST(ActorTest, actorPriority2) {
439+
#ifdef __SKIP_RDAR163604876__
440+
GTEST_SKIP() << "Skipping due to rdar://163604876";
441+
#endif
433442
run([] {
434443
auto actor = createActor();
435444

unittests/runtime/CMakeLists.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,37 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
159159
swiftThreading${SWIFT_PRIMARY_VARIANT_SUFFIX}
160160
${PLATFORM_TARGET_LINK_LIBRARIES}
161161
)
162+
163+
###
164+
# GTEST_SKIP conditions.
165+
#
166+
# Sometimes, we need to skip running a unit test due to some bug on a specific
167+
# platform. You can add a skip like this to the test:
168+
#
169+
# #ifdef __SKIP_RDAR123__
170+
# GTEST_SKIP() << "Skipping due to rdar://123";
171+
# #endif
172+
#
173+
# and use CMake to detect the OS, such as via
174+
#
175+
# if(EXISTS "/etc/os-release")
176+
# file(READ "/etc/os-release" OS_RELEASE)
177+
# if(OS_RELEASE MATCHES "Amazon Linux 2")
178+
# ...
179+
#
180+
# and use
181+
#
182+
# target_compile_definitions(SwiftRuntimeTests PRIVATE __SKIP_RDAR123__)
183+
#
184+
# to add the preprocessor definition.
185+
186+
187+
# A few unit tests with actor scheduling are failing AL2 aarch64 (rdar://163604876)
188+
if(EXISTS "/etc/os-release")
189+
file(READ "/etc/os-release" OS_RELEASE)
190+
if(OS_RELEASE MATCHES "Amazon Linux 2" AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64|arm64")
191+
target_compile_definitions(SwiftRuntimeTests PRIVATE __SKIP_RDAR163604876__)
192+
endif()
193+
endif()
194+
162195
endif()

0 commit comments

Comments
 (0)