Commit Graph
13 Commits
Author SHA1 Message Date
Ian Hays febb25693e FileSystemWatcher test overhaul
Reworks the FSW tests to be 100% passing.
- Adds path validation to most tests.
- Adds a Retry mechanism to handle expected intermittent failures due to untrustworthy underlying API calls.
- Adds more test cases to NotifyFilter and splits existing tests into separate dir/file tests to cover either behavior.
- Enable test parallelization


Commit migrated from https://github.com/dotnet/corefx/commit/28d10fa256f40c3d37a8cb82d96a1e5520df03d2
2016-05-09 11:24:59 -07:00
Ian Hays c0f649508b Modify FileSysemWatcher tests to use temp paths.
- Add Common TempDirectory class for short-term temporary directories that are easy to create and destroy
- Put all FSW tests into the System.IO.Tests namespace
- Modify all FSW tests to use the common TempFile/TempDirectory classes instead of their own custom one
- Modify all FSW tests to watch for events in a temporary directory. There shouldn't be any more new items being created or watched in the runtime folder.
- Fix the SymLink tests to use the ConditionalFact attribute similar to how the FileSystem tests function.
- Remove the unnecessary symlink print statements being outputted by the FileSystem CreateSymbolicLink function.


Commit migrated from https://github.com/dotnet/corefx/commit/65356f9471850b796d01f63536c3ba36e504f8e1
2016-04-22 09:14:49 -07:00
Jonathan Miller 91148f73dd Fixing bug dotnet/corefx#7680 where the FullPath property on the OS X
FileSystemWatcher  was incorrect


Commit migrated from https://github.com/dotnet/corefx/commit/72642adf93a2c7c8280195566295f24fab51987b
2016-04-13 16:58:20 -07:00
Jonathan Miller 074ce18ce4 Fixing bug dotnet/corefx#6675 which prevented the OSX FSW from watching
aliased or symlinked folders.


Commit migrated from https://github.com/dotnet/corefx/commit/3f96a35fb43f83805d6ce611c1bd10c8ae0cd9dd
2016-03-10 17:22:10 -08:00
dotnet-bot 39d1eab950 Update licensing headers
Commit migrated from https://github.com/dotnet/corefx/commit/7cad8486cbabbce0236bdf530e30db7036335524
2016-01-27 08:02:28 -08:00
Jonathan Miller 4306181d9b Refactoring the OS X FileSystemWatcher to more match the Linux implementation
by using an internal Instance class in order to allow each instance to clean
itself up without causing side effects to other instances during rapid
start-stop-start scenarios. This refactor fixes issue dotnet/corefx#4738

Fixing a couple broken UTs by preventing notifications from being sent out for
the watched folder. This fixes dotnet/corefx#4830, dotnet/corefx#4831, and parts of dotnet/corefx#2279


Commit migrated from https://github.com/dotnet/corefx/commit/be314721b0f787a18366d8e01ca677db9219e716
2015-12-04 11:03:18 -08:00
Peter Jas a29604278c code: Fixes occurred spelling.
Fixes dotnet/corefx#3661.


Commit migrated from https://github.com/dotnet/corefx/commit/544a3885ff51e04db89b70e3f155be1a5c64f166
2015-10-06 15:27:09 +00:00
stephentoub df23122fde Fix case sensitivity in FSW Path and Filter tests
Changing to use PathInternal.IsCaseSensitive actually fixed a bug in
FSW.Path/Filter.  The tests were testing for the wrong thing on Linux.
This just fixes the tests.


Commit migrated from https://github.com/dotnet/corefx/commit/b24780dd017f9a6a86fd55531fd9410cab6eef8e
2015-09-22 20:16:17 -04:00
stephentoub 2dd748811e Address various issues in FileSystemWatcher
- On Linux, FileSystemWatcher is built on top of inotify, which has various limits configured in the system for how many instances and watches can be created.  When these limits are hit, exceptions are generated, but the Linux-provided error messages are cryptic about what the problem is.  This change adds better error messages for those cases.  It also ensures that errors regarding watch limits always come out of OnError rather than sometimes being thrown synchronously from EnableRaisingEvents and other times coming out asynchronously.
- As part of fixing that, I noticed that we had some reliability issues around marking the instance as enabled.  I fixed this up to ensure that we only mark the instance as enabled when we've created everything we need to successfully launch it.
- While doing that, I noticed that on OS X, if we restart an FSW, we were unnecessarily re-creating a delegate.  I changed it to avoid the unnecessary allocation.
- And while doing that, I also noticed that we we had a bad exception message when constructing an FSW with something other than a directory.  I fixed the error message.
- I added tests for all these things.


Commit migrated from https://github.com/dotnet/corefx/commit/57cf111281a22feafb83854789680680da3cab50
2015-09-02 16:51:12 -04:00
stephentoub 8ce1a4b748 Allow FSW tests to be parallelized
The FSW tests still take ~10 seconds on my machine, most of which is spent waiting for events to not fire.  This change just separates the tests out so that they're not all on the same class, letting xunit parallelize them.  They now take ~3.5 seconds on my machine.


Commit migrated from https://github.com/dotnet/corefx/commit/2fbabe417accb662a6ed63a40506dea0268cf8e2
2015-08-07 14:17:04 -04:00
Stephen Toub 687d8f5c53 Use DirectorySeparatorChar in a FileSystemWatcher test
Commit migrated from https://github.com/dotnet/corefx/commit/3e41e9b55cd8aaba307f4ea5b419f954d3db58f2
2015-03-24 22:32:52 -07:00
Stephen Toub 6b9fef7a91 Fix FileSystemWatcher src/tests on Linux
This commit fixes issues highlighted when running the System.IO.FileSystem.Watcher tests on Linux.  There are 49 tests that pass on Windows; after these product and test fixes, only 7 of those fail on Linux, all due to Windows-specific tests that will need to be tweaked based on target system or disabled entirely on Linux:
- 2 are P/Invoking to Win32 functions related to security
- 3 are trying to overflow the event buffer but not doing so on Linux
- 2 are expecting case-insensitive file paths


Commit migrated from https://github.com/dotnet/corefx/commit/7176a0dc531a1a9c9032c36330bbf92e7ca57f65
2015-03-23 17:54:49 -07:00
dotnet-bot 254a638e63 Add System.IO.FileSystem.Watcher Source and Tests
Commit migrated from https://github.com/dotnet/corefx/commit/73ab96765fa59e5a1d224ecf804a29379da30c0b
2015-03-09 11:50:41 -07:00