mirror of
https://github.com/BepInEx/dotnet-runtime.git
synced 2026-11-23 03:39:35 -10:00
Merge pull request dotnet/corefx#11721 from ianhays/fsw_maxuserinstances
Remove CreateManyConcurrent test Commit migrated from https://github.com/dotnet/corefx/commit/984a3748cb478c4eec044c4e316da91d09cc1737
This commit is contained in:
commit
14b16a8eae
1 file changed
-31
@@ -542,37 +542,6 @@ namespace System.IO.Tests
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[PlatformSpecific(TestPlatforms.Linux)]
|
||||
[OuterLoop("This test has high system resource demands and may cause failures in other concurrent tests")]
|
||||
public void FileSystemWatcher_CreateManyConcurrentInstances()
|
||||
{
|
||||
int maxUserInstances = int.Parse(File.ReadAllText("/proc/sys/fs/inotify/max_user_instances"));
|
||||
var watchers = new List<FileSystemWatcher>();
|
||||
|
||||
using (var dir = new TempDirectory(GetTestFilePath()))
|
||||
{
|
||||
try
|
||||
{
|
||||
Assert.Throws<IOException>(() =>
|
||||
{
|
||||
// Create enough inotify instances to exceed the number of allowed watches
|
||||
for (int i = 0; i <= maxUserInstances; i++)
|
||||
{
|
||||
watchers.Add(new FileSystemWatcher(dir.Path) { EnableRaisingEvents = true });
|
||||
}
|
||||
});
|
||||
}
|
||||
finally
|
||||
{
|
||||
foreach (FileSystemWatcher watcher in watchers)
|
||||
{
|
||||
watcher.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[PlatformSpecific(TestPlatforms.Linux)]
|
||||
[OuterLoop("This test has high system resource demands and may cause failures in other concurrent tests")]
|
||||
|
||||
Reference in new issue
Block a user