-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Workaround XUnit FileLoadException issues #20644
Conversation
@dotnet-bot test Windows_NT arm Cross Debug Innerloop Build |
java.nio.channels.ClosedChannelException again @dotnet-bot test Windows_NT arm64 Cross Checked Innerloop Build and Test |
java.nio.channels.ClosedChannelException again @dotnet-bot test OSX10.12 x64 Checked Innerloop Build and Test |
java.nio.channels.ClosedChannelException again |
java.nio.channels.ClosedChannelException again in tst job @dotnet-bot test Ubuntu16.04 arm64 Cross Checked no_tiered_compilation_innerloop Build and Test |
This one is got stuck test Ubuntu16.04 arm64 Cross Checked Innerloop Build and Test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very unfortunate workaround.
I would like to see a big comment block in runtest.py stating why this is being done, with description of what is in the replacement assembly, when we can get rid of this code, etc. I'd like to see a comment somewhere that specifies the xunit dependency that refers to this workaround, so if the xunit dependency changes we could remember to remove the workaround.
@BruceForstall I added the comment, can you please take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a few nit comments.
tests/runtest.py
Outdated
print("Download and overwrite xunit.console.dll in Core_Root") | ||
|
||
try: | ||
import urllib.request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would much rather prefer this be wrapped in a statement checking the version like: if sys.version_info < (3,0):
, rather then catching the exception. We will eventually need to remove these python2 isms and this setup makes that work more difficult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest this import be conditional at the header of the file. After the last from import add something like:
# Version specific imports
if sys.version_info < (3,0):
import urllib.request
else:
import urllib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you can add the if here as well. I am fine with changing this to a method call is_python3.
if sys.version_info < (3,0):
urlretrieve = urllib.request.urlretrieve
else:
urlretrieve = urllib.urlretrieve
tests/runtest.py
Outdated
ziparch.extractall(core_root) | ||
|
||
os.remove(zipfilename) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit, extra newline
with zipfile.ZipFile(zipfilename,"r") as ziparch: | ||
ziparch.extractall(core_root) | ||
|
||
os.remove(zipfilename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Add an assert that !os.path.isfile(zipfilename)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, detailed comment. Thanks!
java.nio.channels.ClosedChannelException test Windows_NT arm Cross Checked Innerloop Build and Test |
java.nio.channels.ClosedChannelException test Windows_NT arm Cross Checked Innerloop Build and Test |
test Windows_NT arm Cross Checked Innerloop Build and Test |
In order to mitigate System.IO.FileLoadException we built our own xunit.console.dll with ConcurrentDictionary used for DependencyContextAssemblyCache.managedAssemblyCache instead of Dictionary and use this instead of the one pulled from NuGet.
In order to mitigate System.IO.FileLoadException we built our own xunit.console.dll with ConcurrentDictionary used for DependencyContextAssemblyCache.managedAssemblyCache instead of Dictionary and use this instead of the one pulled from NuGet.
In order to mitigate System.IO.FileLoadException we built our own xunit.console.dll with ConcurrentDictionary used for DependencyContextAssemblyCache.managedAssemblyCache instead of Dictionary and use this instead of the one pulled from NuGet. Commit migrated from dotnet/coreclr@4bcbb70
To workaround XUnit FileLoadException issues use custom xunit.console.dll (2.4.1-pre-4059) with the following changes xunit/xunit#1846 https://github.com/echesakovMSFT/xunit/tree/UseConcurrentDictionaryInDependencyContextAssemblyCache
Related issues: https://github.com/dotnet/coreclr/issues/20392 https://github.com/dotnet/coreclr/issues/20594 xunit/xunit#1842
@RussKeldorph @BruceForstall @jashook PTAL