stryker-mutator / stryker-net

Mutation testing for .NET core and .NET framework!
https://stryker-mutator.io
Apache License 2.0
1.78k stars 187 forks source link

The given key '...csproj' was not present in the dictionary #3071

Open skarllot opened 2 weeks ago

skarllot commented 2 weeks ago

Describe the bug
Stryker started to fail during mutation testing with a KeyNotFoundException after updating to version 4.3.0. The error occurs when it tries to access a project path that is not present in a dictionary.

Logs
The error output:

System.Collections.Generic.KeyNotFoundException: The given key '/home/runner/work/azure-keyvault-reference/azure-keyvault-reference/src/AzureKeyVaultReference.Configuration/AzureKeyVaultReference.Configuration.csproj' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Stryker.Core.Initialisation.EmbeddedResourcesGenerator.GetManifestResources(String assemblyPath, String projectFilePath, String rootNamespace, IEnumerable`1 embeddedResources)+MoveNext()
   ...

Further details can be found in the full logs here:
GitHub Actions logs

Expected behavior
Stryker should successfully generate and compile mutations for the project without encountering missing keys in the dictionary.

Desktop (please complete the following information):

Additional context
The issue seems related to the EmbeddedResourcesGenerator attempting to access a project path (AzureKeyVaultReference.Configuration.csproj) that might be incorrectly referenced or not properly resolved in the mutation process.

dupdob commented 1 day ago

BTW, I opened PR #3095 which is likely to fix the underlying problem. I say 'likely' because, as often with concurrency issue, the issue is difficult to reproduce, so I cannot offer strong guarantee.