* Address more issue numbers in the code
Replaced a bunch of unadorned issue numbers with links, so we know which repo the issue is for. In some cases the repo was named, but for consistency I still replaced it with a link.
In some cases, in particular where the issue had been closed saying effectively "we're not going to do anything here", I removed TODOs and the associated issue numbers.
In a few cases, the TODO and issue number was to say "we should do X when Y is fixed", so I did X since Y was fixed.
* Apply suggestions from code review
Co-Authored-By: Jan Kotas <[email protected]>
* Address PR feedback
* Fix OrderedEnumerable by using MemoryExtensions.Sort
Co-authored-by: Jan Kotas <[email protected]>
Many of our RemoteInvokes are there purely because of needing to change the current thread culture but on UAP that actually impacting the whole process. Until that's addressed, we can at least avoid the RemoteInvoke on all platforms other than UAP. There are also some RemoteInvokes that can be avoided by just serializing all of the (small number of) tests in a test assembly. And there's some additional cleanup to be done as well around not explicitly returning an exit code unless required.
This helps measurably with test performance. Consider the System.ComponentModel.Annotations test suite. On my machine, prior to these changes, it took ~25 seconds; after these changes, it takes ~0.3. It helps even more when running against a checked runtime, where all of our test costs are magnified. With a checked runtime, prior to these changes, it takes ~196 seconds; after these changes, it takes ~2.5 seconds. This should help measurably with CI time in coreclr.
Commit migrated from https://github.com/dotnet/corefx/commit/cd18bafbabf7fe47601f6f790d157409034a2477
Mechanical/automated change. The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.
Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
* Replace "Assert.Equal(true, " with "Assert.True("
* Replace "Assert.Equal(false, " with "Assert.False("
And fix a few Assert.Equal(true cases that deal with objects and thus need to be reverted.
* Replace "Assert.StrictEqual(true, " with "Assert.True("
* Revert a few changes where true/false was being compared to object
* Address PR feedback
Commit migrated from https://github.com/dotnet/corefx/commit/1296bc8386a7283e319ddf723282f16651f9ea5f
* Added support for UF_HIDDEN flag on macOS and FreeBSD (dotnet/corefx#29323)
* Changes based on review
* Reverted UserFlags field
* Sorted include in csproj
* Changed comparison style
* Reverted UserFlags field
* Fixed parentheses
* Changes based on PR review
* Add missing newline
* Add missing newline
Commit migrated from https://github.com/dotnet/corefx/commit/b37f0185ac05c9431389f333f5b2b0fc5fe93e6a
* test added
* rearranging order for if statements
* reducing thread sleep time and reverting millisecond test change
* adding comment
* removing comment, adding tick equality check, failing if not able to create file with non-zero nano or milli second
* correcting test for hfs system
* NanoSeconds -> Nanoseconds, Millisec -> milliseconds
HFs assert converted to false
Commit migrated from https://github.com/dotnet/corefx/commit/83e468591a0212f109c179c2f4b75ef03c92432b
* Initial work on implementing File.Move with overwrite
* Add unit tests for File.Move and FileInfo.MoveTo with overloads for overwrite
* Add MoveFile overload with overwrite parameter to Unix
* Correct namespace for Unix function call
* Separate corefx-specific tests
* Move corefx-specific tests to correct ItemGroup
* * Consolidate error blocks
* Pass named argument for readability
* Remove MOVEFILE_WRITE_THROUGH
* Remove const declaration for MOVEFILE_WRITE_THROUGH since it's not used.
Commit migrated from https://github.com/dotnet/corefx/commit/40364e539572e9dad9c8a2eb165fc9af28e5664a
* MilliSeconds added
* Test Added for move operation
* LastAccessTimeTest
* avoid overflow and using both seconfs and nanoseconds of the native
* feedback addressed
* Tests fixed for CI
* Feedback addressed
* method signature changed
* removing comments
* named argument added
Commit migrated from https://github.com/dotnet/corefx/commit/510eaf10912ce5790302addb0171916b9a134000
* Fix getting attributes for sharing violation files
Some files, such as the pagefile, refuse to allow you to get attributes directly.
You need to enumerate to get the attributes.
Enumerating is expensive, so we had changed from an opt-out to an opt-in. As
it took nearly a year to find this case, switching back to an opt-out with a
larger set of known cases where we get no value from trying again.
Also add an assert to flush out other error codes and scenarios.
* Skip lock test on MacOS (not supported)
* Nano was getting ERROR_NETWORK_UNREACHABLE
Commit migrated from https://github.com/dotnet/corefx/commit/31cdcaa77ab7d03a5430488e180cd1b47d0ee25e
* Update PAL
* Revert PAL
* Add SxS struct
* Test
* CompareTo
* Simple creation time test
* CompareTo public
* Simple creation time test
* typo
* Extract method
* CR feedback
* Look for birthtimespec
* Rework to PAL approach
* comment
* typos
* typo
* Comment
Commit migrated from https://github.com/dotnet/corefx/commit/d75610efce77c2f2562c4f35de901ea38b6d43b7
* Fill out FileSystemInfo state when enumerating
On Windows FileSystemInfos are filled in with state as we have
all of the state from FindFirstFileEx.
* Add more tests
Refactor Time tests and add cases for refresh state.
Fix positive attribute assertion.
* Missed one of the cases
* Tweaking the time tolerance didn't succeed.
Putting it back to -3 seconds.
* Refactor tests
Gets coverage consistent
Fixes test bug in DirectoryInfo where it was creating files for invalid attributes
* Address feedback
Commit migrated from https://github.com/dotnet/corefx/commit/9468aedba81b7d0b43f5545fc840a53544164694
* Fix Unix missing file state
In the original .NET implementation a missing file never
throws directly with FileInfo. Attributes get the error result
from Windows (-1) and times aren't initialized.
* Feedback
* Change FileSystemTest derivation
FileSystemTest should derive from RemoteFileSystemTest so
we can have one base class.
* Add RemoteExecutorBase to performance test project
* Address test feedback
* Fix File.GetAttributes on Unix
NetFX doesn't rely on FileInfo and throws when getting attributes
on missing files through File.
Commit migrated from https://github.com/dotnet/corefx/commit/801dde95a5eac06140d0ac633ac3f9bfdd25aca5
* Remove SerializableAttribute from many CoreFX types that will not be serializable.
* Removes serialization tests for types that are no longer serializable and fixes serializing a couple of types. Includes marking some internal serializable types as public so that they'll be reflectible with .NET Native.
* Remove unneeded pragmas
* Update based on review comments
Commit migrated from https://github.com/dotnet/corefx/commit/6dd451f51451a7d0ceea6104b51bd17005e9a0e6
The FileShareOpen test has been failing sporadically with sharing violations. It turns out the problem has to do with FileShare.Inheritable being included in the list of FileShare values to test. If another test in the same process concurrently spawns a process while a FileShare.Inheritable file is open, that file's handle will be inherited into the child process, which will in turn keep the file in use for longer than the test expects. When it then tries to re-open the file, it may encounter a sharing violation if the subsequent open is incompatible with the previous one's FileShare.
Commit migrated from https://github.com/dotnet/corefx/commit/041672ff3642753807a4502a4c407cb82bfa1009
We've visited this topic a few times... hopefully this is the last. We previously misunderstood some of how Windows handles symlinks, leading us to make some invalid choices on Unix. This addresses those issues.
For the most part with this commit, we now match Windows behavior on Unix wherever possible, while also trying to do something sensible on the Unix side. The only notable difference now comes into play for broken symlinks, due to a fundamental difference between symlinks on Windows and Unix: on Windows, a symlink is created as either a file or directory symlink and thus .NET can tell which it is even if it's broken... on Unix, a symlink only stores a path to its target, so when it's broken, there's no information about whether it's intended to be a file or a directory. As a result, we fall back to always treating it as a file.
Commit migrated from https://github.com/dotnet/corefx/commit/59da18fc926397f6674e1de86e296ca6e0dfe067
Previously on unix we would use stat to get information about directories and files for DirectoryInfo and FileInfo. That meant that we wouldn't correctly report ReparsePoint for symlinks, and the code was changed to use LStat. But that then breaks important use cases, such as by DirectoryInfo.Exist for a symlink to a directory always returning false.
This commit provides a compromise: we first use lstat, and if we find it's a symlink, we use stat but remember separately that it's a symlink so we can include ReparsePoint in the reported attributes.
Commit migrated from https://github.com/dotnet/corefx/commit/36259dc3c72fb1dc2a71a06db6f7dce9ea88c642