Skip to content

--info argument for native AoT tests throws an exception #3096

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

Closed
martincostello opened this issue Jun 13, 2024 · 2 comments · Fixed by #3118
Closed

--info argument for native AoT tests throws an exception #3096

martincostello opened this issue Jun 13, 2024 · 2 comments · Fixed by #3118
Assignees
Labels
Area: MTP Belongs to the Microsoft.Testing.Platform core library sprint

Comments

@martincostello
Copy link

Describe the bug

A KeyNotFoundException occurs when running a native AoT test program when passed the --info argument.

Steps To Reproduce

  1. Clone martincostello/alexa-london-travel@e01e882
  2. Open the test/LondonTravel.Skill.NativeAotTests directory in the terminal
  3. Run dotnet run -- --info

Expected behavior

No exception is shown and the process exits with an exit code of 0.

Actual behavior

The process exits with an exit code of -532462766 and prints the following at the end of the console output:

<SNIP - Lots of other output before this>

Registered tools:
  TrxCompareTool
    Command: ms-trxcompare
    Name: TRX comparer tool
    Version: 1.2.1
    Description: This tool allows to compare and highights differences between 2 TRX reports
    Tool command line providers:
Unhandled exception. System.Collections.Generic.KeyNotFoundException: The given key 'ms-trxcompare' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.Testing.Platform.CommandLine.CommandLineHandler.<PrintInfoAsync>g__DisplayRegisteredToolsInfoAsync|36_5(ITool[] availableTools, List`1 toolExtensions) in /_/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineHandler.cs:line 572
   at Microsoft.Testing.Platform.CommandLine.CommandLineHandler.PrintInfoAsync(ITool[] availableTools) in /_/src/Platform/Microsoft.Testing.Platform/CommandLine/CommandLineHandler.cs:line 440
   at Microsoft.Testing.Platform.Hosts.TestHostBuilder.BuildAsync(String[] args, ApplicationLoggingState loggingState, TestApplicationOptions testApplicationOptions, IUnhandledExceptionsHandler unhandledExceptionsHandler, DateTimeOffset createBuilderStart) in /_/src/Platform/Microsoft.Testing.Platform/Hosts/TestHostBuilder.cs:line 296
   at Microsoft.Testing.Platform.Builder.TestApplicationBuilder.BuildAsync() in /_/src/Platform/Microsoft.Testing.Platform/Builder/TestApplicationBuilder.cs:line 113
   at TestingPlatformEntryPoint.Main(String[] args) in C:\Coding\martincostello\alexa-london-travel\artifacts\obj\LondonTravel.Skill.NativeAotTests\debug\TestPlatformEntryPoint.cs:line 17
   at TestingPlatformEntryPoint.<Main>(String[] args)

Additional context

Found while trying to work out how to get tests to either timeout or blame hangs before opening #3095.

@martincostello martincostello changed the title --info argument for native AoT tests throws an argument --info argument for native AoT tests throws an exception Jun 13, 2024
@MarcoRossignoli MarcoRossignoli added Type: Bug Area: MTP Belongs to the Microsoft.Testing.Platform core library and removed Needs: Triage 🔍 labels Jun 13, 2024
@MarcoRossignoli
Copy link
Contributor

Thanks for reporting it

@Evangelink Evangelink self-assigned this Jun 17, 2024
@Evangelink
Copy link
Member

I can repro even in non NAOT mode. This repros only when using MSTest.Sdk and not when using metapackage or regular packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: MTP Belongs to the Microsoft.Testing.Platform core library sprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants