Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail intermittently with different exceptions #2563

Open
gao-artur opened this issue Mar 14, 2024 · 6 comments
Open

Tests fail intermittently with different exceptions #2563

gao-artur opened this issue Mar 14, 2024 · 6 comments

Comments

@gao-artur
Copy link

We have an infrastructure to run integration tests with 3rd party dependencies running in k8s pods. As part of the test init process, we start different pods (MySQL, RabbitMQ, MongoDB, etc) and then run our test suits against these pods. Sometimes, the initialization process fails with strange exceptions that, I believe, obscure the real reason for failure. For example, we observed such behavior in the past when pods were killed because of OOM. Here are some examples of these exceptions

Class Initialization method XXX.ClassInit threw exception. System.BadImageFormatException: Index not found. (0x80131124).

Initialization method XXX.TestInit threw exception. System.Security.SecurityException: Invalid assembly public key. (0x8013141E).

Class Initialization method XXX.ClassInit threw exception. System.BadImageFormatException: Could not load file or assembly '�#, Version=32002.1205.1024.18, Culture=neutral, PublicKeyToken=01c0628b004400c06293007701c1628b09883fe0628b004400e0629300770100638b00440000639300770104638b09c72020638b00440020639300770124638b09c72040638b00440040639300770160638b00440060639300770181638b09c720816313004400a1631300440041648b09c72060648b00'. Index not found. (0x80131124).

Assembly Initialization method XXX.AssemblyInit threw exception. System.InvalidOperationException: The DbContext of type '��.' cannot be pooled because it does not have a public constructor accepting a single parameter of type DbContextOptions or has more than one constructor.. Aborting test execution.

We executed tests with --blame-crash --blame-crash-dump-type full flags. But I wasn't able to debug the created dump. Let me know how I can send it to you if it's useful (~80MB).

Additional info:

.NET SDK v7.0.313

Microsoft.NET.Test.Sdk v17.6.3
MSTest.TestAdapter v3.1.1
MSTest.TestFramework v3.1.1

@Evangelink
Copy link
Member

You are mentioning .NET SDK 7, shall I assume that your test project is targeting .NET 7 or is it a netfx target? Would it be possible to have the diagnostic logs (VSTest) of both a working and failing build?

@gao-artur
Copy link
Author

All projects are targeting .NET 7.
Can I send you the logs via a private channel? I'd prefer not to share them publicly.

@Evangelink
Copy link
Member

The best is to report issues through developercommunity, I recommend looking at https://learn.microsoft.com/cpp/overview/how-to-report-a-problem-with-the-visual-cpp-toolset?view=msvc-170#to-create-a-problem-report-for-private-information that explains well how to add private information.

@Evangelink
Copy link
Member

Could you make some test with our runner too? It's possible that the behavior would be different since you would not be using VSTest platform.

@gao-artur
Copy link
Author

Sure. Will try next week.

@gao-artur
Copy link
Author

Hi. I'm currently busy with other tasks and can't make the test with a new runner, but I am very interested in finding the root cause for the failures. Please keep this issue open and I hope to provide more info during the next month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants