Commit Graph
8 Commits
Author SHA1 Message Date
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 6c5af28f87 Change timeouts on FSW tests
When we're waiting for an event that we know will arrive, we can wait for a fairly long time, because if it doesn't arrive we're going to fail the tests anyway.  This changes makes all of the ExpectEvent calls use a long timeout, much longer than most were previously using.  In the process I removed all of the custom values being passed, as they were all the same or shorter than the new default.  This should help to minimize avoid false positive flakiness.


Commit migrated from https://github.com/dotnet/corefx/commit/81e84b7910244f2f72ba760c100b16c01a38877c
2015-08-11 19:36:20 -04:00
stephentoub d6467ac0af Use RuntimeInformation across corefx for platform detection
This commit deletes our temporary Interop.PlatformDetection.cs mechanism and replaces usage of it with usage of System.Runtime.InteropServices.RuntimeInformation.dll.


Commit migrated from https://github.com/dotnet/corefx/commit/6861b625b391566544be9a60356c8c03b15e5fb5
2015-08-06 10:25:17 -04:00
Jonathan Miller 1d2f6fe59e Adding new Unit Tests to validate the more complex FileSystemWatcher
scenarios: symlinks, deep directory structures, and preseeded directories.


Commit migrated from https://github.com/dotnet/corefx/commit/c41c161d721f16bc0c83fe7c1d77378c06f005c3
2015-08-05 14:30:54 -07:00
Ian Hays e6e252aabf Modified Unix File.Move to use link/unlink instead of rename
Changed the way the UnixFileSystem does File moving; it was previously implemented using the rename syscall but now uses a combination of link and unlink. The side effect of this change is that the FileSystemWatcher will now treat File.Move as a deletion.

- Resolves dotnet/corefx#2460
- Removed all tests from FileSystemWatcher that made calls to File.Move and consolidated them into a new file: FileSystemWatcher.MoveFile.cs. This new file separates tests into Windows and Unix categories and uses Theories to supply the input WatcherChangeType and whether a move should trigger an event for the given type. If we later decide to change the Unix behavior of MoveFile, changing the FileSystemWatcher tests will be a simple matter of flipping the boolean values for the affected tests.
- Fixed some comments in UnixFileSystem to be more specific to FileSystemWatcher
- Changed variable names for FSW Move tests to be more descriptive
- Modified FSW MoveFile and Utitlity helper classes to use guids so that they may be run concurrently.


Commit migrated from https://github.com/dotnet/corefx/commit/cae7c5116d46c0d98e6f0fb3526fa2a15945501a
2015-08-04 15:47:56 -07:00
stephentoub 782d1a5d02 Fix ObjectDisposedException in FileSystemWatcher tests
In my code review of @sokket's new FileSystemWatcher tests (dotnet/corefx#2347), I'd encouraged him to clean up some of the AutoResetEvents that were being created, in the name of good hygiene.  But this introduces a sporadic failure in the tests due to a race condition.

The way that FileSystemWatcher is designed, stopping events on the instance doesn't actually prevent any in-progress operations from being processed, nor does stopping block until all in-process events have completed.  As such, if after stopping processing we dispose of an event that's going to be set by one of the callbacks, it's possible such a set could occur from an in-flight operation after we've already disposed of the event, leading to an ObjectDisposedException that crashes the tests.

I contemplated adding synchronization to FSW itself to avoid these kinds of race conditions, e.g. by ensuring that the call to set "Enabled = false;" won't return until all in-progress operations have completed, but that could cause deadlocks not currently possible.  As such, I simply stopped explicitly disposing of the events created in the tests, leaving the cleanup to finalization (as is already done for most other events in the tests).


Commit migrated from https://github.com/dotnet/corefx/commit/43bfad63384aee6eb7e20c064054c5e1cd00fbf0
2015-07-22 17:09:31 -04:00
Jonathan Miller a179a5735a Adding new Unit Tests to the FileSystemWatcher code base and fixing a
small bug in the Linux FileSystemWatcher that would notify a listener
about a new directory before we had a chance to process it, which
could lead to missed notifications and not fit user expectations.


Commit migrated from https://github.com/dotnet/corefx/commit/750602b098ceef5aa11ab626bdb359980dd1aa02
2015-07-16 14:59:21 -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