Skip to content

Conversation

@akoeplinger
Copy link
Member

Allows the tests to run on WebAssembly: Tests run: 329, Errors: 0, Failures: 0, Skipped: 5. Time: 1.0009759s

{
WriteToReadOnlyFile(access, access == MemoryMappedFileAccess.Read ||
(!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && geteuid() == 0));
(!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && PlatformDetection.IsSuperUser));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it fine to remove !RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && since it feels redundant to check for windows twice when IsBrowser is false? Would hitting PNSE on windows be a problem?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the way that IsSuperUser is written, if we remove the Windows check here, it would throw PlatformNotSupportedException and crash the tests.

Copy link
Member Author

@akoeplinger akoeplinger Jul 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no we need to keep this since PlatformDetection.IsSuperUser would throw PlatformNotSupportedException if we ran it on Windows

edit GitHub didn't load @safern's comment at first so sorry for the double post 😄

@akoeplinger akoeplinger merged commit 46ca4d7 into dotnet:master Jul 15, 2020
@akoeplinger akoeplinger deleted the wasm-memory-mapped-files branch July 15, 2020 20:22
/// Test to validate we can create multiple maps from the same FileStream.
/// </summary>
[Fact]
[PlatformSpecific(~TestPlatforms.Browser)] // the emscripten implementation doesn't share data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean? Is the behaviour unexpected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marek-safar kind of, though sharing an mmap'd file is not the common case. we could probably looking into detecting the situation and throwing a proper exception (right now the second mmap just doesn't see the modifications from the first mmap)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a tracking issue instead of ignoring the tests

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karelz karelz added this to the 5.0.0 milestone Aug 18, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants