Skip to content

Commit 554d819

Browse files
authored
[ci] Automatically retry failed native unit test failures once (#1095)
Context: #514 There is a known native crash that occasionally occurs when running unit tests on CI; see Issue #514: * Assertion: should not be reached at class-accessors.c:81 ================================================================= Native Crash Reporting ================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= ================================================================= Native stacktrace: ================================================================= 0x102d2091b - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : mono_dump_native_crash_info 0x102cb97b5 - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : mono_handle_native_crash 0x102d1fe71 - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : sigabrt_signal_handler 0x7fff79156b5d - /usr/lib/system/libsystem_platform.dylib : _sigtramp 0x10a126f87 - Unknown 0x7fff790106a6 - /usr/lib/system/libsystem_c.dylib : abort 0x102f28837 - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : monoeg_assert_abort 0x102f09a9f - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : mono_log_write_logfile 0x102f28bbe - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : monoeg_g_logv_nofree 0x102f28d3f - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : monoeg_assertion_message 0x102db6ee5 - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : mono_class_get_flags 0x102dac83b - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : mono_class_setup_fields 0x102dacdc1 - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : mono_class_init_internal 0x102da7e7f - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : mono_class_is_subclass_of_internal 0x102e2e4f3 - /Library/Frameworks/Mono.framework/Versions/Current/Commands/mono : mono_class_is_subclass_of 0x106bf1348 - /Users/runner/runners/2.160.0/work/1/s/bin/TestDebug/libjava-interop.dylib : _ZL19get_gc_bridge_indexP19JavaInteropGCBridgeP10_MonoClass 0x106bf0a4c - /Users/runner/runners/2.160.0/work/1/s/bin/TestDebug/libjava-interop.dylib : _ZL20gc_bridge_class_kindP10_MonoClass SIGQUIT: [libjvm.dylib+0x49bf1d], sa_mask[0]=11111111011111110111111111111111, sa_flags=SA_RESTART|SA_SIGINFO Start time: 2019-11-04 19:57:01Z End time: 2019-11-04 19:57:02Z Duration: 1.803 seconds This crash doesn't happen "in the wild" so it is unlikely to get fixed anytime soon. As a workaround for our CI, we will use AzDO's [`retryCountOnTaskFailure` parameter][0] to automatically re-run a native test suite once if it fails. This should reduce the need for us to re-run failed pipelines for flaky tests. Note that AzDO's implementation isn't perfect; the task will succeed if there are no failures on retry, but the original failures will still be listed in the log. 🤷‍♂️ [0]: https://learn.microsoft.com/en-us/azure/devops/release-notes/2021/pipelines/sprint-195-update#automatic-retries-for-a-task
1 parent 71e586b commit 554d819

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build-tools/automation/templates/core-tests.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ steps:
8484
testRunTitle: Java.Interop (netstandard2.0 - ${{ parameters.platformName }})
8585
arguments: bin/Test$(Build.Configuration)/Java.Interop-Tests.dll
8686
continueOnError: true
87+
retryCountOnTaskFailure: 1
8788

8889
- task: DotNetCoreCLI@2
8990
displayName: 'Tests: Java.Interop'
@@ -93,6 +94,7 @@ steps:
9394
testRunTitle: Java.Interop ($(DotNetTargetFramework) - ${{ parameters.platformName }})
9495
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop-Tests.dll
9596
continueOnError: true
97+
retryCountOnTaskFailure: 1
9698

9799
- task: DotNetCoreCLI@2
98100
displayName: 'Tests: Java.Interop.Dynamic'
@@ -102,6 +104,7 @@ steps:
102104
testRunTitle: Java.Interop.Dynamic (${{ parameters.platformName }})
103105
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop.Dynamic-Tests.dll
104106
continueOnError: true
107+
retryCountOnTaskFailure: 1
105108

106109
- task: DotNetCoreCLI@2
107110
displayName: 'Tests: Java.Interop.Export'
@@ -111,6 +114,7 @@ steps:
111114
testRunTitle: Java.Interop.Export (${{ parameters.platformName }})
112115
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop.Export-Tests.dll
113116
continueOnError: true
117+
retryCountOnTaskFailure: 1
114118

115119
- task: DotNetCoreCLI@2
116120
displayName: 'jnimarshalmethod-gen Java.Interop.Export-Tests.dll'
@@ -120,6 +124,7 @@ steps:
120124
custom: bin/$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/jnimarshalmethod-gen.dll
121125
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop.Export-Tests.dll -v -v --keeptemp -o bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)
122126
continueOnError: true
127+
retryCountOnTaskFailure: 1
123128

124129
- task: DotNetCoreCLI@2
125130
displayName: 'Tests: Java.Interop.Export w/ jnimarshalmethod-gen!'
@@ -129,6 +134,7 @@ steps:
129134
testRunTitle: Java.Interop.Export (jnimarshalmethod-gen + ${{ parameters.platformName }})
130135
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop.Export-Tests.dll
131136
continueOnError: true
137+
retryCountOnTaskFailure: 1
132138

133139
- task: DotNetCoreCLI@2
134140
displayName: 'Tests: Java.Interop-Performance-net472'
@@ -138,6 +144,7 @@ steps:
138144
testRunTitle: Java.Interop-Performance (net472 - ${{ parameters.platformName }})
139145
arguments: bin/Test$(Build.Configuration)/Java.Interop-PerformanceTests.dll
140146
continueOnError: true
147+
retryCountOnTaskFailure: 1
141148

142149
- task: DotNetCoreCLI@2
143150
displayName: 'Tests: Java.Interop-Performance-$(DotNetTargetFramework)'
@@ -147,6 +154,7 @@ steps:
147154
testRunTitle: Java.Interop-Performance ($(DotNetTargetFramework) - ${{ parameters.platformName }})
148155
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Interop-PerformanceTests.dll
149156
continueOnError: true
157+
retryCountOnTaskFailure: 1
150158

151159
- task: DotNetCoreCLI@2
152160
displayName: 'Tests: Java.Base'
@@ -156,6 +164,7 @@ steps:
156164
testRunTitle: Java.Base ($(DotNetTargetFramework) - ${{ parameters.platformName }})
157165
arguments: bin/Test$(Build.Configuration)$(NetCoreTargetFrameworkPathSuffix)/Java.Base-Tests.dll
158166
continueOnError: true
167+
retryCountOnTaskFailure: 1
159168

160169
- task: DotNetCoreCLI@2
161170
displayName: 'Tests: java-source-utils'

0 commit comments

Comments
 (0)