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:
Stephen Toub authored and GitHub committed 2016-10-05 14:31:55 -04:00
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")]