diff options
author | Alexis Christoforides <alexis@thenull.net> | 2019-01-26 01:02:25 +0300 |
---|---|---|
committer | Alexis Christoforides <alexis@thenull.net> | 2019-06-19 05:26:57 +0300 |
commit | 7c4300aa7ffc530ce330ce1654179d06f66ae611 (patch) | |
tree | a24f6911dfaa63d54250f092685fa21f8b362f5b /mcs/class/System | |
parent | cc6a2d46066fb4f3e6755c419066d0485ea15c92 (diff) |
[filewatcher] Fall back to default if a new instance cannot be created
Diffstat (limited to 'mcs/class/System')
-rw-r--r-- | mcs/class/System/Test/System.IO/FileSystemWatcherTest.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mcs/class/System/Test/System.IO/FileSystemWatcherTest.cs b/mcs/class/System/Test/System.IO/FileSystemWatcherTest.cs index 585c15bcf77..358a43eb1cd 100644 --- a/mcs/class/System/Test/System.IO/FileSystemWatcherTest.cs +++ b/mcs/class/System/Test/System.IO/FileSystemWatcherTest.cs @@ -95,6 +95,20 @@ namespace MonoTests.System.IO fw.Path = "*"; } } + + [Test] + [Category ("NotOnMac")] // creates resource exhaustion issues + public void LargeNumberOfInstances () + { + using (var tmp = new TempDirectory ()) { + var watchers = new FileSystemWatcher [256]; + for (int x = 0; x < watchers.Length; x++) + { + watchers[x] = new FileSystemWatcher (tmp.Path, "*"); + watchers[x].EnableRaisingEvents = true; + } + } + } } } |