-
Notifications
You must be signed in to change notification settings - Fork 323
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
Test host crashes at cleanup with COMException #4222
Comments
Hi @kunom, thank you for the analysis and the report. We will investigate the issue. |
hi |
@kunom how are you running test in your agent? |
@MarcoRossignoli Sorry the slow feedback, was in holiday. At least some of the red tests runs are executed with - task: AzureCLI@2
displayName: "dotnet test (solution) with azure connection"
inputs:
# Referencing the 'azureSubscription' within this 'AzureCLI' task implictly enables us to make use of the existing service connection from Azure DevOps to Azure.
# This allows us to authorize ourself via new DefaultAzureCredential() within our integration tests against Azure resources.
azureSubscription: ${{ parameters.azureSubscription }}
scriptType: pscore
scriptLocation: inlineScript
inlineScript: dotnet test ${{parameters.solutionPath}} --configuration ${{parameters.buildConfiguration}} ${{parameters.appliedTestFilter}} --no-restore --no-build --logger trx --collect:"XPlat Code Coverage" --results-directory $(Agent.TempDirectory) -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[*Tests?]*
env:
${{ each parameter in parameters.testEnvironmentVariables }}:
${{ parameter.Key }}: ${{ parameter.Value }} Other occurances are with - task: DotNetCoreCLI@2
displayName: "dotnet test (solution)"
inputs:
command: test
arguments: '--configuration $(BuildConfiguration) $(excludeFlakyAndQuarantined) --no-restore --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[*Tests?]*'
projects: $(Build.SourcesDirectory)/NexusPlatform/Nexus.sln
env:
TESTING_ASB_CONNINFO: $(TESTING_ASB_CONNINFO) # secret variables must be explicitly mapped
TESTING_SLOWDOWNFACTOR: $(TESTING_SLOWDOWNFACTOR) |
@MarcoRossignoli Do you need some more information? The issue keeps occurring in our pipelines, and I tend to write a retry loop to get around the issue. |
I don't need any other information thanks, I think it's a race condition where we try to get information from host process already closed. |
@kunom I did a small fix to avoid the crash, anyway we will return -1 so you see failed tests in this case, we cannot access to the real exit value of the test host so we cannot be sure that the host didn't failed some tests. |
@MarcoRossignoli Thanks! |
On our build agents, we occasionally observe red test execution with all test cases green. It seems to be that the crash happens at test cleanup:
The crucial part here is that
Process.get_HasExited
is documented to crash with InvalidOperationException, Win32Exception or NotSupportedException, none of which includes the COMException.I wonder whether there is a missing call to
Process.WaitForExit()
as documented in the same location for asynchronous event handlers, but in general I have no clue what is going on. I tend to think that there is a race condition in theProcess
class:This issue occurred 3 times in the last 600 analyzed runs.
The text was updated successfully, but these errors were encountered: