Fix MMF test failure due to inheritable handles#6984
Fix MMF test failure due to inheritable handles#6984stephentoub merged 1 commit intodotnet:masterfrom
Conversation
Some tests create maps with inheritable handles. Other tests launch processes. If those tests end up running concurrently in a manner where the launched process inherits the handle, it'll end up extending the lifetime of the map beyond what the tests were expecting. This has been leading to random test failures like "Cannot create a file when that file already exists". This commit simply disables parallelization of the MMF tests. This has little impact on the running time of the tests, but if in the future we add the ability to disable inheriting handles when using Process.Start, we could use that instead.
|
@dotnet-bot test this please |
1 similar comment
|
@dotnet-bot test this please |
|
If this turns out to be a more widespread problem, I wonder if it might be worth solving it more generally. For example, could we define attributes like: ...so any tests marked with Even if we do provide a way to create processes that don't inherit handles, we'll still need to test the mode where handles are inherited... And this it sort of problem is bound to come up elsewhere as well. But yeah, it's overkill for this change. :) LGTM. |
|
Thanks, Eric. Certainly something we can investigate for the future. Given the extensibility points currently available via xunit, I believe that would either require using such attributes instead of Fact/Theory and writing our own discoverers/test case execution/etc. for those, or plugging in at an even higher level and replacing all of the test execution infrastructure. |
Fix MMF test failure due to inheritable handles
Some tests create maps with inheritable handles. Other tests launch processes. If those tests end up running concurrently in a manner where the launched process inherits the handle, it'll end up extending the lifetime of the map beyond what the tests were expecting. This has been leading to random test failures like "Cannot create a file when that file already exists".
This commit simply disables parallelization of the MMF tests. This has little impact on the running time of the tests, but if in the future we add the ability to disable inheriting handles when using Process.Start, we could use that instead.
Fixes https://github.com/dotnet/corefx/issues/6911
cc: @ericeil, @ianhays