Commit Graph
31 Commits
Author SHA1 Message Date
Stephen Toub 4c9eb2ec25 Simplify built-in types across corefx tests (dotnet/corefx#30660)
Commit migrated from https://github.com/dotnet/corefx/commit/7ae1a252d7e68c5513d2658de7a401c37e9b0504
2018-06-25 22:42:04 -07:00
Anirudh Agnihotry 46c3899a36 Added Filters Property to FileSystemWatcher class (dotnet/corefx#29315)
* Filters Property and tests added

* Tests fixed for osx

* Tests fixed for netfx and error message improved

* Tests fixed for netfx and error message improved

* Added tests for insert,contains ,removeat, index of , to string and gettype

* ToString removed and asser.equal corrected

* Comments and overload of epectevent added for netcoreapp

* Removed duplicate code

* setup and execution separated

* Expected patshs argument added

* ExpectNoEvent Added, negative added for all the test , expected path problem corrected

* handler

* Storing tuple and Unexpected Events

* name added to return values tuples


Commit migrated from https://github.com/dotnet/corefx/commit/9f2377fcd4e46f2c607d03672ed0bb92fe9cb68e
2018-05-15 01:03:38 +05:30
Jeremy Kuhne 383d9ef979 Cut string allocations for filtered watcher files (dotnet/corefx#29227)
* Cut string allocations for filtered watcher files

This changes the Win32 watcher code to not allocate strings until after we've matched the name and know that we're going to actually fire an event.

Unix code can be changed to encode into a temporary buffer to get a similar reduction. I'll open an up-for-grabs issue on it.

Flip a test to have expected in the expected argument.

* Move loop inside fixed statement

* Move locals inside fixed block.


Commit migrated from https://github.com/dotnet/corefx/commit/11a12e6538a0a024c3adfb944c3983c0d66c3768
2018-04-20 18:36:12 -07:00
Jeremy Kuhne 7b52244b37 Use FileSystemName in FileSystemWatcher (dotnet/corefx#28220)
* Use FileSystemName in FileSystemWatcher

- Uses newer spanified version in FileSystemName
- Doesn't allow extended match chars `<`, `>`, `"`  as these are legal in Unix

* Plumb through the case sensitivity

* Update tests

* Tweak test for netfx

* Tweak the comment to be a bit more readable


Commit migrated from https://github.com/dotnet/corefx/commit/fcfb556ebf99ed551c02d0146c805e792b264cf2
2018-03-20 21:43:47 -07:00
Marco Rossignoli 10a39d487c Improve InvalidDirectory error in FileSystemWatcher (dotnet/corefx#25485)
Another place where message could be more precise on FileSystemWatcher.
Fixes dotnet/corefx#24817

Commit migrated from https://github.com/dotnet/corefx/commit/771136cc013f8ac833f005e7193428e71966c5fe
2017-11-27 11:15:00 -08:00
Dan Moseley b27ba97af5 Rename IsWinRT to IsInAppContainer (dotnet/corefx#23935)
* Rename IsWinRT to IsInAppContainer

* Grep error


Commit migrated from https://github.com/dotnet/corefx/commit/8d51233795da222041c23d33b1eb44bbe458d0eb
2017-09-11 02:57:28 -04:00
Hugh Bellamy 7cbcd5ed85 Convert most Assert.Throws<ArgumentException> without param name to AssertExtensions (dotnet/corefx#21455)
* Registry

* Collections

* ComponentModel

* Configuration

* Data

* Globalization

* Drawing

* Diagnostics

* IO

* Linq

* Add System.Net param names in tests

* Move ArgumentExceptions in System.Private.Xml to AssertExtensions

* Add System.Reflection.* ArgumentException param names

* Add param names for System.Runtime* ArgumentExceptions

* Add ArgumentException param names to System.Security.*

* Add ArgumentException param names to System.Text.*

* Add param names to ArgumentExceptions in misc projects

* Add System.Threading.* ArgumentException param names

* Fix missing files

* Fixes for unix and netfx

* Fix more failures and revert a IdnaConformance tests to avoid merge conflicts with dotnet/corefx#21463


Commit migrated from https://github.com/dotnet/corefx/commit/59915687bb261efeae70565d0ca8990ac45ceb9c
2017-06-23 12:33:47 -07:00
Daniel Harvey 252cdc5e95 Bulk updates of tests for AssertExtensions (dotnet/corefx#18491)
Bulk update to AssertExtensions.Throws for AOT support. This doesn't disable Assert.Throws.

Commit migrated from https://github.com/dotnet/corefx/commit/b43b4df2e0e2182154bb0f425cb4a61bc1269828
2017-04-18 09:52:02 -07:00
danmosemsft 436098c2d8 Disable test for UWP
Commit migrated from https://github.com/dotnet/corefx/commit/221ebe188de359a5cd6a7f229ab20cfcc021172c
2017-04-06 15:58:04 -07:00
sepidehMS e3d734c19d Add comments to PlatformSpecific tests
Commit migrated from https://github.com/dotnet/corefx/commit/493cb79ff4976479be5cc7c6f1fe2d5d9b710425
2017-02-07 15:46:26 -08:00
Ian Hays e3733e9157 Fix some intermittently failing Desktop FSW tests (dotnet/corefx#15007)
* Fix some intermittently failing Desktop FSW tests

They're failing for misc reasons but mostly are plagued by timeouts. I excluded some actual failures and increased timeouts for the other ones so desktop FSW runs should be clean going forward.

* Make FSW_NotifyFilter test catch any ArgException

This is so it still runs on desktop and isn't just flat out excluded.

* Fix FSW StopCalledOnBackgroundThread test

* fix FSW test


Commit migrated from https://github.com/dotnet/corefx/commit/f548a49b0d40b90b45ef43ea27bd99e16c50676c
2017-01-11 13:40:01 -08:00
Ian Hays 180cadd449 Remove the CreateManyConcurrent test
The test is causing intermittent failures in other tests and is also intermittently failing itself. Without modifying system resources we can't make this test trustworthy, so it's better to remove it for the sake of stability.


Commit migrated from https://github.com/dotnet/corefx/commit/2dab1441d118a81cda174a18b884aa3e1c627cd2
2016-10-04 08:36:30 -07:00
Justin Van Patten aa68f5ce2f Replace uses of Xunit.PlatformID with renamed TestPlatforms
Replace uses of `Xunit.PlatformID` with renamed `TestPlatforms` because
the old name conflicts with `System.PlatformID` and should be plural
according to the design guidelines for flags enums.


Commit migrated from https://github.com/dotnet/corefx/commit/5179dda7331b1e201519adf76ce9ae69ffe2a0f6
2016-10-01 17:18:41 -07:00
Ian Hays f8f269ff93 Expose InternalBufferOverflowException in FSW (dotnet/corefx#11785)
* Expose InternalBufferOverflowException in FSW
Updates the default targetgroup of filesystemwatcher to netstandard1.7 and exposes InternalBufferOverflowException out of System.IO.FileSystemWatcher.

Commit migrated from https://github.com/dotnet/corefx/commit/148e7d9c6f52f4639226753b0656188e72878c2b
2016-09-30 10:31:41 -04:00
Eric Eilebrecht f877780ab0 Re-enable tests for System.IO.FileSystem.Watcher and System.Net.Ping, on Windows Subsystem for Linux.
These tests now pass, as of Windows 10 preview build 14926.


Commit migrated from https://github.com/dotnet/corefx/commit/947fc61f03b42f88ab2c7ed6de0513c86546f96a
2016-09-14 14:38:38 -07:00
Ian Hays 2cfb99941a Add Outerloop messages and cleanup FSW tests
Commit migrated from https://github.com/dotnet/corefx/commit/f9f626d63eb7de1fc41d68c5e1602f86e86014d1
2016-09-13 10:38:38 -07:00
Eric Eilebrecht be96f805d0 Work around known issues in "Ubuntu on Windows" (dotnet/corefx#11574)
The latest Windows 10 preview builds contain enough functionality in Ubuntu/Bash on Windows (a.k.a. Windows Subsystem for Linux, or WSL) that .NET Core mostly works now. With the fix for dotnet/corefx#11058, we can even build/test the CoreFx tree in this environment. Currently there are a few test failures; I've been working on identifying the causes of these, and filing bugs in the appropriate repos. 
This change implements workarounds for all of the current known issues in the "inner loop" tests. Mostly, I've just conditionally disabled tests when running in the WSL environment. 
There is still an issue, under investigation, causing non-deterministic failures in the System.Net.Http tests (Microsoft/BashOnWindowsdotnet/corefx#1068). And I haven't tried OuterLoop runs of anything but the networking tests. 

Commit migrated from https://github.com/dotnet/corefx/commit/d9aa92f6616d851256339318aadb89a6737e6d13
2016-09-09 20:10:01 -07:00
Ian Hays a30acca4b1 Move some flaky FSW tests to Outerloop
All of the FSW tests are potentially subject to intermittent failures because of the inherint flakiness of the underlying OS file system watching APIs. Although we do some manual stuff to get around that flakiness (e.g. retries, long timeouts), some scenarios aren't reliable enough to make it through. This commit moves those to Outerloop so they don't get in the way of our gated check in tests.


Commit migrated from https://github.com/dotnet/corefx/commit/c827a452b599d67fe68773b96b4da75044452446
2016-09-01 14:28:30 -07:00
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