Commit Graph
1561 Commits
Author SHA1 Message Date
Ahson Khan fc292cfab0 Split OwnedMemory into MemoryManager and IMemoryOwner (dotnet/corefx#28640)
* Update IRetainable, OwnedMemory, and MemoryHandle APIs

* Split OwnedMemory into MemoryManager and IMemoryOwner

* Update ReadOnlySequence, ArrayMemoryPool, and BufferSegment

* Update System.Memory and System.IO.Pipeline tests

* Temporarily skipping the failing Pipelines tests until impl is corrected.

* Update the reference assembly to match implementation and cleanup

* Update API compat baseline for UAPAOT and add GenFacadesIgnoreMissingTypes

* Fix the System.Runtime ref

* Add back the Pin methods to the uapaot api compat baseline

* Clone the API compat baseline from uapaot and add it for uap as well.

* Update BuildTools, CoreClr, CoreFx, CoreSetup, ProjectNTfs, ProjectNTfsTestILC to preview3-02630-01, preview3-26330-08, preview3-26330-06, preview3-26330-04, beta-26330-00, beta-26330-00, respectively

* Fix pipelines tests and update the api compat baseline shim for uapaot

* Add empty Unpin override to pipe pool test.

* Fix the System.Net.Http Functional tests


Commit migrated from https://github.com/dotnet/corefx/commit/f592e887e2349ed52af6a83070c42adb9d26408c
2018-03-30 14:30:48 -07:00
Dan Moseley f384b7e87f Prevent CMake 2.8 tests failing for unused variable (causing millisec to be dropped from stat calls) (dotnet/corefx#28573)
* Prevent CMake 2.8 tests failing for unused variable

* Make sterror_r test fail as it should

* Reenable tests



Commit migrated from https://github.com/dotnet/corefx/commit/2c0a662262a6ad8bfdfb97dd786db2734c24754b
2018-03-29 11:32:50 +02:00
Anirudh Agnihotry 0b8a5e8523 Refactor FileSystem recursive directory tests (dotnet/corefx#28421)
Commit migrated from https://github.com/dotnet/corefx/commit/a2b423529ec9a94885535a7f557a1cbbe2ba788e
2018-03-26 21:59:53 -07:00
Alexander Radchenko 0ddb5aba01 Fixed netfx System.IO.FileSystem.Tests fails on non-English Windows (dotnet/corefx#28313)
Commit migrated from https://github.com/dotnet/corefx/commit/544f3c2afcfb096f59e678fbf8a7ce8938be72c9
2018-03-23 11:31:34 -04:00
Anirudh Agnihotry 281ee60d7d Disabling test on alpine (dotnet/corefx#28401)
* Disabling test on alpine

* Alpine Detection added to platformDetection

* ref and win updated


Commit migrated from https://github.com/dotnet/corefx/commit/c239771fe12ad9e591fc288a8bf8757c4dba84a8
2018-03-23 09:22:35 -04:00
Anirudh Agnihotry 30dd3e1437 perf tests for create and delete directory (dotnet/corefx#28381)
Commit migrated from https://github.com/dotnet/corefx/commit/5669f06e9c9fd19687d90cbbc11db00dc7dbfc82
2018-03-23 00:52:52 -07:00
Stephen Toub 0b2f137b73 Fix File.ReadAllBytes{Async} for virtual file system files (dotnet/corefx#28388)
Some file systems, like procfs, can return 0 for a file's length, even though it actually contains on-demand computed contents.  This breaks File.ReadAllBytes{Async}, which currently assumes that a length of 0 means the file is empty.  This commit fixes it by changing the assumption to mean that a length of 0 means we can't depend on the Length and instead need to read until EOF.

Commit migrated from https://github.com/dotnet/corefx/commit/77bf4078608a5229afd3132115638b59215f478b
2018-03-22 23:11:07 -04:00
Dan Moseley 7ff0126590 Disable Millisec test on Linux (dotnet/corefx#28345)
* Disable Millisec test on Linux

* Feedback


Commit migrated from https://github.com/dotnet/corefx/commit/3a59545a9fb5a6d7cdd272cb79c6fc8251ac2e0c
2018-03-21 21:56:12 -07:00
Jan Kotas cab7e9e4a0 WIP: Enable TimesIncludeMillisecondPart on selected filesystems only (dotnet/corefx#28242)
* Enable TimesIncludeMillisecondPart on selected filesystems only

Use filesystem name to suppress the test failure

* Make the test fail

* Break out tests


Commit migrated from https://github.com/dotnet/corefx/commit/a31762f7fd5b580a6f583b3bbb69fb9e75b87d14
2018-03-20 22:17:25 -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
Anirudh Agnihotry ee37ef81ec RefApiCompat for isolatedStorage (dotnet/corefx#28120)
Commit migrated from https://github.com/dotnet/corefx/commit/dd4519d0373e26789905a4836c3fc88a9257cc1c
2018-03-17 23:04:42 -07:00
Jeremy Kuhne e4c7177641 Use Win32Marshal from CoreLib shared code (dotnet/corefx#28161)
* Use Win32Marshal from CoreLib shared code

Fix hr issue caught by Common.Tests.

* Move string condition inside exception arguments


Commit migrated from https://github.com/dotnet/corefx/commit/c4d9e0c960e5ee2da3402703c5f02472cbb7e592
2018-03-17 07:15:24 -04:00
Jeremy Kuhne 3071222fa1 Check for name surrogates when deleting reparse points (dotnet/corefx#28124)
Name surrogates are the only type of reparse points that we should be simply detaching.
All other reparse points we should be drilling into- this was causing issues for OneDrive
cloud files.

Commit migrated from https://github.com/dotnet/corefx/commit/4ea280efe691313e08d7648064566440dd35190b
2018-03-16 14:53:51 -07:00
Anirudh Agnihotry 4a52e4c4e0 Fixing NonBreakingSpace test on OSX using FSAssert (dotnet/corefx#28094)
Commit migrated from https://github.com/dotnet/corefx/commit/a89e7ad8e09fe133fefd76aea902232892453561
2018-03-15 12:45:40 -07:00
Jan Kotas 27e74e82eb Fix unbounded stackalloc in System.IO.FileSystem (dotnet/corefx#28004)
Commit migrated from https://github.com/dotnet/corefx/commit/bf36018813d2724e5bc9140d72e0d8bf92f2b621
2018-03-12 21:23:36 -07:00
Wes Haggard 4195372484 Merge pull request dotnet/corefx#27881 from weshaggard/ReverseApiCompat
Enable reverse APICompat for 1:1 libraries

Commit migrated from https://github.com/dotnet/corefx/commit/c45c7a7439ab2925d1a6e17e80f396a6bd35c17b
2018-03-12 10:21:05 -07:00
Jeremy Kuhne 04f40ee2bb More FileSystem tests (dotnet/corefx#27955)
- Fix dotnet/corefx#27244 validation
- Add more enumerable tests

Fixes dotnet/corefx#27244

Commit migrated from https://github.com/dotnet/corefx/commit/b4dfbadf5dd4410616061ddb1057f1bcee7bb41f
2018-03-11 18:59:23 -07:00
Jeremy Kuhne 10c2a8b41a Add more alternate data stream tests (dotnet/corefx#27945)
Commit migrated from https://github.com/dotnet/corefx/commit/de1878e129d4e44f4bccac3bae28612357c6a79d
2018-03-10 23:31:04 -08:00
Jeremy Kuhne 4f51a26e7e Start adding alternate data stream tests (dotnet/corefx#27931)
* Start adding alternate data stream tests

Also fill out ExampleTests.

* Skip on NetFX


Commit migrated from https://github.com/dotnet/corefx/commit/f35784eec7b78132e8c257e5f96f3e62aad14533
2018-03-10 17:30:01 -08:00
Jeremy Kuhne 231f26e3dd Test changes for System.IO.FileSystem (dotnet/corefx#27923)
* Test changes

- Add new tests for more coverage on enumeration
- Re-enable tests

* Add missing assert


Commit migrated from https://github.com/dotnet/corefx/commit/0e70b43de9d13a629082ec878411c4662557e9e1
2018-03-09 20:01:56 -08:00
Wes Haggard 4d97955681 Consolidate matching ref generated baseline files
This change collapses some baseline files as well as fixes
some of the reference mis-matches


Commit migrated from https://github.com/dotnet/corefx/commit/8842923d3d6bc357d39b34c93353df952ac02079
2018-03-09 15:43:29 -08:00
Wes Haggard dccc06ade2 Baseline all reverse apicompat issues
Commit migrated from https://github.com/dotnet/corefx/commit/ddb31b5d2f393cf1a16653ff99736a6f25cd98b5
2018-03-09 15:43:29 -08:00
Anirudh Agnihotry b543c3ed1c WhiteSpace and PrefixParent subdirectory names throw exception (dotnet/corefx#27810)
Commit migrated from https://github.com/dotnet/corefx/commit/59f6987b7fc919a438060f6c502c3c9cf7c8af29
2018-03-07 17:02:05 -08:00
Anirudh Agnihotry 2a687498bb Test for enumerateDirectories NonBreaking space (dotnet/corefx#27762)
Commit migrated from https://github.com/dotnet/corefx/commit/61aaf07bf486e457fa6d3f19f8335b0d536d7bca
2018-03-07 16:59:14 -08:00
Jeremy Kuhne afb3e61fb6 Dial back \\?\ insertion (dotnet/corefx#27827)
Only premptively adding for FileSystemInfo if we end in period or space.
Long path is taken care of later.

Clean up code a little and add test for DirectoryInfo.Move.

Commit migrated from https://github.com/dotnet/corefx/commit/cc4abcad12da4d6abe4af8c5b4cd9d328ca97715
2018-03-07 15:58:06 -08:00
Jeremy Kuhne 91eeb8e129 Support trimmed paths in FileInfo (dotnet/corefx#27809)
* Support trimmed paths in FileInfo

Some paths are not creatable in Windows without special syntax. Notably paths with trailing spaces and periods. As GetFullPath() (and GetFullPathName()) trim these we would lose the correct file name as we passed the path around. With the enumeration changes we now populate FileInfo correctly- this change allows the other methods to work when wrapped around such a path.

* Tweak comments.
Remove NotSupported and SecurityException from Exists as these are no longer thrown.
Add a test fix I hadn't staged correctly.


Commit migrated from https://github.com/dotnet/corefx/commit/41a2120b233cc02c175f812e4e19e3f058396cb0
2018-03-07 10:14:24 -08:00
Anirudh Agnihotry 6dff4e5f8e enable failing tests due to paths (dotnet/corefx#27681)
Commit migrated from https://github.com/dotnet/corefx/commit/91b311e840646cd343db5cb97622b53ce14334e3
2018-03-05 10:25:12 -08:00
Jan Kotas a015dbdcc0 Cleanup one last StringBuilderCache usage in System.IO.FileSystem (dotnet/corefx#27720)
ReadAllTextAsync is convenience method that allocates a lot anyway, so the saving from StringBuilderCache is unlikely to show up. And this method is unlikely to be used for small strings where StringBuilderCache helps anyway.

Commit migrated from https://github.com/dotnet/corefx/commit/80918915b4df50047e763a3a6ee36aa20809e6da
2018-03-05 09:04:42 -05:00
Stephen Toub 7482b6a4b0 Expose and roll out ValueTask extensibility
This commit does several things:
- Exposes the new `ValueTask` extensibility model being added in coreclr.  The ValueTask-related files will separately be mirrored over to corefx to enable the netstandard build of System.Threading.Tasks.Extensions.
- Adapts all `Stream`-derived types to return `ValueTask` instead of `Task` from `WriteAsync`.
- Changes the new `WebSocket` `SendAsync` method to return `ValueTask` instead of `Task`, and updates the `ManagedWebSocket` implementation accordingly.  Most `SendAsync`s on `ManagedWebSocket` should now return a `ValueTask` that's either completed synchronously (no allocation) or using a pooled object.  It now uses the underlying transport's new `WriteAsync` overload that returns `ValueTask`.
- Switches more uses of `ReadAsync` and `WriteAsync` over to the new overloads, including in Process, DeflateStream, BrotliStream, File, HttpClient, SslStream, WebClient, BufferedStream, CryptoStream,
- Removed some unnecessary array clearing from various routines using ArrayPool (after the clearing was added we changed our minds and decided clearing was only necessary in very specific circumstances)
- Implements a custom `IValueTaskSource` in Socket, such that async receives and sends become allocation-free (ammortized).  `NetworkStream` then inherits this functionality, such that its new `ReadAsync` and `WriteAsync` are also allocation-free (in the unbounded channel implementations; we can subsequently add it in for bounded).
- Implements a custom `IValueTaskSource` in System.Threading.Channels, such that reading and writing are ammortized allocation-free up to one concurrent reader and writer.
- A few random things I noticed as I was going through, e.g. missing ConfigureAwait, some incorrect synchronization in tests, etc.
- Adds a ton of new tests, mainly in System.Threading.Tasks.Extensions, System.Threading.Channels, and System.Net.Sockets.


Commit migrated from https://github.com/dotnet/corefx/commit/6d1671b2cfcf130b7bc6c059bb0508073426532a
2018-03-02 09:56:25 -08:00
Jeremy Kuhne 26afe83908 Remove span helpers, use mirrored PathInternal helper (dotnet/corefx#27585)
* Remove span helpers, use mirrored PathInternal helper

Remove other unnecessary helpers (notably with Path.Join available)

* Fix Unix


Commit migrated from https://github.com/dotnet/corefx/commit/f25eb288a449010574a6e95fe298f3ad880ada1e
2018-02-28 22:30:31 -08:00
William Godbe c46aedadc2 Stop FileSystem WriteAsync test from writing too much data to disk (dotnet/corefx#27387)
* Stop FileSystem WriteAsync test from writing too much data to disk

* Fix TotalBytesWritten

* Move bytes written cap to inner loop

* Fix do/while syntax, add cancellation token back

* Remove token


Commit migrated from https://github.com/dotnet/corefx/commit/09b4ad86c48485426feb2536d7d48dd36ba9c884
2018-02-28 22:01:06 -08:00
Dan Moseley 0c07197707 Logging for TimesIncludeMillisecondPart test and reenable for Linux (dotnet/corefx#27559)
* Logging for TimesIncludeMillisecondPart test

* Enable test for Linux

* Formatting


Commit migrated from https://github.com/dotnet/corefx/commit/0c4fe29556861d5e728cd1f47afb687eb2711623
2018-02-28 21:45:20 -08:00
Jeremy Kuhne a7998874ee Fix a bug in TranslateWin32Expression (dotnet/corefx#27539)
Add test coverage.

Commit migrated from https://github.com/dotnet/corefx/commit/d2a2221640d86036e0d5e6cf51f6d3a8258e6baa
2018-02-28 10:11:41 -08:00
Stephen Toub ff964cd53c Disable failing System.IO tests
Commit migrated from https://github.com/dotnet/corefx/commit/303922a96cc14b3db2150c01f44ffe5dacb18fee
2018-02-28 09:03:28 -05:00
Stephen Toub 1c54785d43 Make File.Move copy when the file system doesn't support link (dotnet/corefx#27371)
Commit migrated from https://github.com/dotnet/corefx/commit/fb0cbae3e0275fdf9b2b7bc734422c88285acafb
2018-02-22 16:34:01 -05:00
Jeremy Kuhne 973cec3dd6 Update tests for Path changes (dotnet/corefx#27348)
* Update tests for Path changes

Updates for https://github.com/dotnet/coreclr/pull/16478

* Add back Unix active issue (wishful thinking that this would get the same error on Unix)

* Address feedback


Commit migrated from https://github.com/dotnet/corefx/commit/92afa6ec21817739ebf45cd66b4569a03b54d4c0
2018-02-22 12:13:29 -08:00
Jeremy Kuhne c60340730c Make final API review changes to file enumeration (dotnet/corefx#27318)
* Make final API review changes to file enumeration

Tweak stack array initialization to just zero the first element in matcher algorithm.

cc: @danmosemsft @terrajobst

* Don't null out the native name to track conversion


Commit migrated from https://github.com/dotnet/corefx/commit/62878f34d65f8bac6f7ebd91083fb9a02866de98
2018-02-21 19:32:31 -08:00
Atsushi Kanamori 0cebe1e3f1 Rename string-slicing extension methods (dotnet/corefx#27328)
* Rename string-slicing extension methods

As part of 

https://github.com/dotnet/corefx/issues/26894

the api folks have approved renaming AsROSpan and AsROMemory
on string instances to AsSpan and AsMemory (as the "readonly"
is obvious given the read-only nature of the input.)

This puts the renaming in effect. Basically a big search-replace
commit.

* Fix OpenSSL build break

* I see this is going to be a treadmill


Commit migrated from https://github.com/dotnet/corefx/commit/3538128fa1fb2b77a81026934d61cd370a0fd7f5
2018-02-21 11:48:51 -08:00
Jan Kotas 40fb7ad23d Replace ValueStringBuilder.set_Length with indexer (dotnet/corefx#27274)
Indexer that let's you see and edit the content of the pending string is more efficient and flexible.

Fixes dotnet/corefx#26643

Commit migrated from https://github.com/dotnet/corefx/commit/e45523d96acf833d727636fffeeb763b02a2360e
2018-02-20 11:14:57 -05:00
Stephen Toub 971d1b5a8d Disabling CanRecurseFromRoot test, again (dotnet/corefx#27276)
Commit migrated from https://github.com/dotnet/corefx/commit/2fe35d98cd2ceb7e5649321a49039ec27ccbff6e
2018-02-20 08:02:52 -05:00
Jeremy Kuhne 2302d48348 Handle errors getting state in Unix (dotnet/corefx#27239)
* Handle errors getting state in Unix

Throwing errors while examining extended state while enumerating isn't consistent with Windows behavior. Windows never throws past getting directory entry data as all state is already available.

Ensure entry attribute state is consistent with initial construction.

* Win 7 CI machines are also setting NotContentIndexed.


Commit migrated from https://github.com/dotnet/corefx/commit/597f44c5056badfb47f45731480454d698849800
2018-02-19 21:01:21 -08:00
Jeremy Kuhne 5fc9a345f7 Update root dir enum test (dotnet/corefx#27254)
Update assert for better logging. Skip directory entries.

fixes dotnet/corefx#27244

Commit migrated from https://github.com/dotnet/corefx/commit/59b2bfdc28ab814553601379392ebfe24eb610aa
2018-02-19 17:22:47 -08:00
Stephen Toub 47813df24c Disable CanRecurseFromRoot test (dotnet/corefx#27252)
Commit migrated from https://github.com/dotnet/corefx/commit/336bc1868948c01db4ba72be49c2b959099e542d
2018-02-19 12:57:48 -05:00
Jeremy Kuhne 1db4e20423 Fix enumerating the root directory. (dotnet/corefx#27223)
* Fix enumerating the root directory.

Shouldn't trim the trailing separator when at the root. On Windows that makes
the path drive relative- which breaks most of the logic.

Add a test to catch this case.

* Add the Unix part of the fix.


Commit migrated from https://github.com/dotnet/corefx/commit/5b4ce203c563a20053f32f9901ea6b7dc67c8e37
2018-02-16 21:52:07 -08:00
Jeremy Kuhne e9d845d7ff Use NtCreateFile on Win32 (dotnet/corefx#27195)
NtCreateFile allows passing in a base handle which makes opening child directories much faster. This cuts anywhere from 3-10% of the time off of a GetFiles() call.

It is significantly faster as it avoids normalization and path parsing overhead.

Commit migrated from https://github.com/dotnet/corefx/commit/a28a2cdda67c024126f690bbe1331174a194f9ce
2018-02-16 11:10:07 -08:00
Jeremy Kuhne 23c14fe5cf Remove FileSystem unused common files (dotnet/corefx#27184)
Also update .sln using UpdateVSConfigurations

Commit migrated from https://github.com/dotnet/corefx/commit/7eb6dba62ec630d33db7dcd9e810a937a92d975f
2018-02-15 18:45:51 -08:00
Jeremy Kuhne b6811353d3 Change RootDirectory properties to span (dotnet/corefx#27134)
Exposing string restricts the ability to change internals without introducing unnecessary allocations.

Commit migrated from https://github.com/dotnet/corefx/commit/3ac69e86e0c8e654a9802bf593fdc98ea69a4fb8
2018-02-15 16:41:51 -08:00
Jeremy Kuhne 3bbc710304 Current directory code duplicates Environment (dotnet/corefx#27153)
Just call Environment.CurrentDirectory. Remove a number of P/Invokes
that are no longer in use.

Commit migrated from https://github.com/dotnet/corefx/commit/8e6222ab2f2b48f20a274272693665dac8259c79
2018-02-15 10:32:03 -08:00
Jeremy Kuhne 8dc5e67384 Cleaning out dead code (dotnet/corefx#27150)
Also refactor Unix attribute handling a bit to be more consistent and
ensure that we don't make unnecessary addtional filesystem calls.

Commit migrated from https://github.com/dotnet/corefx/commit/16f26ba855f5cc6d52a738e8bc3856c6f77cf761
2018-02-14 22:49:17 -08:00
Maryam Ariyan 065c7bfa8e Adding test to verify FileStream.Dispose() ignores IO Related Exception in finalizer (dotnet/corefx#26921)
* Adding test to verify FileStream.Dispose() skips IO Related Exception only on finalization

* Skipping test on netfx because the behavior in netfx is different


Commit migrated from https://github.com/dotnet/corefx/commit/a15cc53eb5a4248c76bdc60beb3e31628bd8acf8
2018-02-14 22:20:00 -05:00