This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit c18b9f1eb008bc0704d411f4c43511baddc13007
Author: Shad Storhaug <[email protected]>
AuthorDate: Tue Oct 18 21:28:19 2022 +0700

    publish-test-results.yml: Added check for assembly binding failure to 
detect crashed runs. See #699.
---
 .build/azure-templates/publish-test-results.yml | 18 +++++++++++-------
 .build/azure-templates/run-tests-on-os.yml      |  3 ++-
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/.build/azure-templates/publish-test-results.yml 
b/.build/azure-templates/publish-test-results.yml
index 8fb4db36a..28f428136 100644
--- a/.build/azure-templates/publish-test-results.yml
+++ b/.build/azure-templates/publish-test-results.yml
@@ -1,4 +1,4 @@
-# Licensed to the Apache Software Foundation (ASF) under one
+# Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
 # regarding copyright ownership.  The ASF licenses this file
@@ -73,12 +73,16 @@ steps:
                     if ($reader.Name -eq 'RunInfos') {
                         $inRunInfos = $true
                     }
-                    if ($inRunInfos -and !$crashed -and $reader.Name -eq 
'Text' -and $reader.ReadInnerXml().Contains('Test host process crashed')) {
-                        Write-Host "##vso[task.setvariable 
variable=HostCrashed;]true"
-                        # Report all of the test projects that crashed
-                        $crashedRuns = 
"$env:CRASHEDRUNS,$testProjectName".TrimStart(',')
-                        Write-Host "##vso[task.setvariable 
variable=CrashedRuns;]$crashedRuns"
-                        $crashed = $true
+                    if ($inRunInfos -and !$crashed -and $reader.Name -eq 
'Text') {
+                        $innerXml = $reader.ReadInnerXml()
+                        # Test for specific error messages - we may need to 
adjust this, as needed
+                        if ($innerXml -and ($innerXml.Contains('Test host 
process crashed') -or $innerXml.Contains('Could not load file or assembly'))) {
+                            Write-Host "##vso[task.setvariable 
variable=HostCrashed;]true"
+                            # Report all of the test projects that crashed
+                            $crashedRuns = 
"$env:CRASHEDRUNS,$testProjectName".TrimStart(',')
+                            Write-Host "##vso[task.setvariable 
variable=CrashedRuns;]$crashedRuns"
+                            $crashed = $true
+                        }
                     }
                 }
                 if ($reader.NodeType -eq [System.Xml.XmlNodeType]::EndElement 
-and $reader.Name -eq 'RunInfos') {
diff --git a/.build/azure-templates/run-tests-on-os.yml 
b/.build/azure-templates/run-tests-on-os.yml
index b1282f20a..9250f0bee 100644
--- a/.build/azure-templates/run-tests-on-os.yml
+++ b/.build/azure-templates/run-tests-on-os.yml
@@ -251,7 +251,8 @@ steps:
 - pwsh: |
     $failed = $false
     if ($env:HOSTCRASHED -eq 'true') {
-        Write-Host "##vso[task.logissue type=error;]Test host process(es) 
crashed:  $($env:CRASHEDRUNS)."
+        $runsExpanded = "$($env:CRASHEDRUNS)" -replace ',',"`r`n"
+        Write-Host "##vso[task.logissue type=error;]Test host process(es) 
crashed, hung, or failed to load assemblies. Review the testresults artifacts 
for details. (click here to view the projects that failed)`r`n$runsExpanded"
         $failed = $true
     }
     $maximumAllowedFailures = '${{ parameters.maximumAllowedFailures }}'

Reply via email to