Skip to content

Commit 3e3fd87

Browse files
mdh1418Mitchell Hwangakoeplingerdirecthex
authored
[release/6.0] Skip test suites crashing on CI for iOS/tvOS/MacCatalyst and test fixes for Android (#58841)
Manual backport of #57208, #58519, #58562, #58210, #57732, #58428, #58586, #58745, #57687 to release/6.0 Numerous test suites have been failing for iOS/tvOS/MacCatalyst consistently on CI without useful logs as to why. Moreover, some of these suites pass locally. This PR looks to reduce the failures on CI by skipping the problematic suites Skips test suites logged in #53624 ActiveIssues #58440 #58418 #58367 #58584 Co-authored-by: Mitchell Hwang <[email protected]> Co-authored-by: Alexander Köplinger <[email protected]> Co-authored-by: Jo Shields <[email protected]>
1 parent d6a35f3 commit 3e3fd87

File tree

22 files changed

+128
-91
lines changed

22 files changed

+128
-91
lines changed

src/libraries/Common/src/Interop/Unix/System.Native/Interop.MountPoints.FormatInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ private static DriveType GetDriveType(string fileSystemName)
8080
// This list is based primarily on "man fs", "man mount", "mntent.h", "/proc/filesystems", coreutils "stat.c",
8181
// and "wiki.debian.org/FileSystem". It can be extended over time as we find additional file systems that should
8282
// be recognized as a particular drive type.
83+
// Keep this in sync with the UnixFileSystemTypes enum in Interop.UnixFileSystemTypes.cs
8384
switch (fileSystemName)
8485
{
8586
case "cddafs":

src/libraries/Common/src/Interop/Unix/System.Native/Interop.UnixFileSystemTypes.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ internal enum UnixFileSystemTypes : long
2828
befs = 0x42465331,
2929
bdevfs = 0x62646576,
3030
bfs = 0x1BADFACE,
31+
bpf_fs = 0xCAFE4A11,
3132
binfmt_misc = 0x42494E4D,
3233
bootfs = 0xA56D3FF9,
3334
btrfs = 0x9123683E,
@@ -53,6 +54,7 @@ internal enum UnixFileSystemTypes : long
5354
ext2 = 0xEF53,
5455
ext3 = 0xEF53,
5556
ext4 = 0xEF53,
57+
f2fs = 0xF2F52010,
5658
fat = 0x4006,
5759
fd = 0xF00D1E,
5860
fhgfs = 0x19830326,
@@ -122,6 +124,7 @@ internal enum UnixFileSystemTypes : long
122124
sysv2 = 0x012FF7B6,
123125
sysv4 = 0x012FF7B5,
124126
tmpfs = 0x01021994,
127+
tracefs = 0x74726163,
125128
ubifs = 0x24051905,
126129
udf = 0x15013346,
127130
ufs = 0x00011954,

src/libraries/Microsoft.Extensions.FileProviders.Physical/tests/PhysicalFileProviderTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void PollingFileProviderShouldntConsumeINotifyInstances()
137137
}
138138
}
139139
}
140-
140+
141141
private void GetFileInfoReturnsNotFoundFileInfoForIllegalPathWithLeadingSlashes(string path)
142142
{
143143
using (var provider = new PhysicalFileProvider(Path.GetTempPath()))
@@ -936,6 +936,7 @@ public void NoopChangeTokenForFilterThatNavigatesAboveRoot()
936936

937937
[Fact]
938938
[ActiveIssue("https://github.com/dotnet/runtime/issues/34582", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
939+
[ActiveIssue("https://github.com/dotnet/runtime/issues/58584", TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS)]
939940
public void TokenForEmptyFilter()
940941
{
941942
using (var root = new DisposableFileSystem())

src/libraries/Native/Unix/System.Native/pal_io.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,7 @@ int64_t SystemNative_GetFileSystemType(intptr_t fd)
14271427
else if (strcmp(statfsArgs.f_basetype, "befs") == 0) result = 0x42465331;
14281428
else if (strcmp(statfsArgs.f_basetype, "bdevfs") == 0) result = 0x62646576;
14291429
else if (strcmp(statfsArgs.f_basetype, "bfs") == 0) result = 0x1BADFACE;
1430+
else if (strcmp(statfsArgs.f_basetype, "bpf_fs") == 0) result = 0xCAFE4A11;
14301431
else if (strcmp(statfsArgs.f_basetype, "binfmt_misc") == 0) result = 0x42494E4D;
14311432
else if (strcmp(statfsArgs.f_basetype, "bootfs") == 0) result = 0xA56D3FF9;
14321433
else if (strcmp(statfsArgs.f_basetype, "btrfs") == 0) result = 0x9123683E;
@@ -1452,6 +1453,7 @@ int64_t SystemNative_GetFileSystemType(intptr_t fd)
14521453
else if (strcmp(statfsArgs.f_basetype, "ext2") == 0) result = 0xEF53;
14531454
else if (strcmp(statfsArgs.f_basetype, "ext3") == 0) result = 0xEF53;
14541455
else if (strcmp(statfsArgs.f_basetype, "ext4") == 0) result = 0xEF53;
1456+
else if (strcmp(statfsArgs.f_basetype, "f2fs") == 0) result = 0xF2F52010;
14551457
else if (strcmp(statfsArgs.f_basetype, "fat") == 0) result = 0x4006;
14561458
else if (strcmp(statfsArgs.f_basetype, "fd") == 0) result = 0xF00D1E;
14571459
else if (strcmp(statfsArgs.f_basetype, "fhgfs") == 0) result = 0x19830326;
@@ -1519,6 +1521,7 @@ int64_t SystemNative_GetFileSystemType(intptr_t fd)
15191521
else if (strcmp(statfsArgs.f_basetype, "sysv2") == 0) result = 0x012FF7B6;
15201522
else if (strcmp(statfsArgs.f_basetype, "sysv4") == 0) result = 0x012FF7B5;
15211523
else if (strcmp(statfsArgs.f_basetype, "tmpfs") == 0) result = 0x01021994;
1524+
else if (strcmp(statfsArgs.f_basetype, "tracefs") == 0) result = 0x74726163;
15221525
else if (strcmp(statfsArgs.f_basetype, "ubifs") == 0) result = 0x24051905;
15231526
else if (strcmp(statfsArgs.f_basetype, "udf") == 0) result = 0x15013346;
15241527
else if (strcmp(statfsArgs.f_basetype, "ufs") == 0) result = 0x00011954;
@@ -1560,13 +1563,21 @@ int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length,
15601563
struct flock lockArgs;
15611564
#endif
15621565

1566+
#if defined(TARGET_ANDROID) && defined(HAVE_FLOCK64)
1567+
// On Android, fcntl is always implemented by fcntl64 but before https://github.com/aosp-mirror/platform_bionic/commit/09e77f35ab8d291bf88302bb9673aaa518c6bcb0
1568+
// there was no remapping of F_SETLK to F_SETLK64 when _FILE_OFFSET_BITS=64 (which we set in eng/native/configurecompiler.cmake) so we need to always pass F_SETLK64
1569+
int command = F_SETLK64;
1570+
#else
1571+
int command = F_SETLK;
1572+
#endif
1573+
15631574
lockArgs.l_type = unixLockType;
15641575
lockArgs.l_whence = SEEK_SET;
15651576
lockArgs.l_start = (off_t)offset;
15661577
lockArgs.l_len = (off_t)length;
15671578

15681579
int32_t ret;
1569-
while ((ret = fcntl (ToFileDescriptor(fd), F_SETLK, &lockArgs)) < 0 && errno == EINTR);
1580+
while ((ret = fcntl (ToFileDescriptor(fd), command, &lockArgs)) < 0 && errno == EINTR);
15701581
return ret;
15711582
}
15721583

src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestsWriteEventToListener.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@ public void Test_EventSourceCreatedEvents_AfterListener()
452452
[Theory]
453453
[InlineData(true)]
454454
[InlineData(false)]
455+
[ActiveIssue("https://github.com/dotnet/runtime/issues/51382", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]
455456
public void Test_EventListenerThrows_ExceptionIsNotRethrownToCaller(bool setThrowOnEventWriteErrorsFlag)
456457
{
457458
TestUtilities.CheckNoEventSourcesRunning("Start");

src/libraries/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.WaitForChanged.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public void NonZeroTimeout_NoEvents_TimesOut(bool enabledBeforeWait)
111111
[InlineData(WatcherChangeTypes.Changed, false)]
112112
[InlineData(WatcherChangeTypes.Renamed, true)]
113113
[InlineData(WatcherChangeTypes.All, true)]
114+
[ActiveIssue("https://github.com/dotnet/runtime/issues/58418", typeof(PlatformDetection), nameof(PlatformDetection.IsMacCatalyst), nameof(PlatformDetection.IsArm64Process))]
114115
public void NonZeroTimeout_NoActivity_TimesOut(WatcherChangeTypes changeType, bool enabledBeforeWait)
115116
{
116117
using (var testDirectory = new TempDirectory(GetTestFilePath()))

src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewAccessor.Tests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ public void ValidAccessLevelCombinations(MemoryMappedFileAccess mapAccess, Memor
9191
}
9292
catch (UnauthorizedAccessException)
9393
{
94-
if ((OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst() || PlatformDetection.IsInContainer) &&
94+
if ((OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || PlatformDetection.IsInContainer) &&
9595
(viewAccess == MemoryMappedFileAccess.ReadExecute || viewAccess == MemoryMappedFileAccess.ReadWriteExecute))
9696
{
97-
// Containers and OSX with SIP enabled do not have execute permissions by default.
97+
// Containers and OSXlike platforms with SIP enabled do not have execute permissions by default.
9898
throw new SkipTestException("Insufficient execute permission.");
9999
}
100100

src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@ public void ValidAccessLevelCombinations(MemoryMappedFileAccess mapAccess, Memor
9191
}
9292
catch (UnauthorizedAccessException)
9393
{
94-
if ((OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst() || PlatformDetection.IsInContainer) &&
94+
if ((OperatingSystem.IsMacOS() || OperatingSystem.IsMacCatalyst() || OperatingSystem.IsIOS() || OperatingSystem.IsTvOS() || PlatformDetection.IsInContainer) &&
9595
(viewAccess == MemoryMappedFileAccess.ReadExecute || viewAccess == MemoryMappedFileAccess.ReadWriteExecute))
9696
{
97-
// Containers and OSX with SIP enabled do not have execute permissions by default.
97+
// Containers and OSXlike platforms with SIP enabled do not have execute permissions by default.
9898
throw new SkipTestException("Insufficient execute permission.");
9999
}
100100

File renamed without changes.

src/libraries/System.Net.Http/src/System.Net.Http.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" />
3636
<ILLinkSubstitutionsXmls Condition="'$(TargetsAndroid)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true' or '$(TargetsTVOS)' == 'true'"
3737
Include="$(ILLinkDirectory)ILLink.Substitutions.mobile.xml" />
38+
<ILLinkSuppressionsXmls Condition="'$(TargetsMobile)' == 'true'" Include="$(ILLinkDirectory)ILLink.Suppressions.Mobile.LibraryBuild.xml" />
3839
</ItemGroup>
3940
<ItemGroup>
4041
<Compile Include="System\Net\Http\ByteArrayContent.cs" />

0 commit comments

Comments
 (0)