From 54f145c8653033a4b6b6d3a4105044b8c8ce474c Mon Sep 17 00:00:00 2001 From: Alan McGovern Date: Mon, 1 Jul 2024 00:08:37 +0100 Subject: [PATCH] Work around a shutdown bug The most common reason for red CI builds is a bug in the shutdown path where an async callback from HttpListener does not have a try/catch for when the underlying handle has already been disposed. Starting test execution, please wait... A total of 1 test files matched the specified pattern. The active test run was aborted. Reason: Test host process crashed : Unhandled exception. System.ObjectDisposedException: Safe handle has been closed. Object name: 'SafeHandle'. at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success) at Interop.HttpApi.HttpCancelHttpRequest(SafeHandle requestQueueHandle, UInt64 requestId, IntPtr pOverlapped) at System.Net.HttpListenerContext.ForceCancelRequest(SafeHandle requestQueueHandle, UInt64 requestId) at System.Net.HttpListenerContext.Abort() at System.Net.HttpResponseStream.EndWriteCore(IAsyncResult asyncResult) at System.Net.HttpListenerResponse.NonBlockingCloseCallback(IAsyncResult asyncResult) at System.Net.LazyAsyncResult.Complete(IntPtr userToken) at System.Net.HttpResponseStreamAsyncResult.IOCompleted(HttpResponseStreamAsyncResult asyncResult, UInt32 errorCode, UInt32 numBytes) at System.Net.HttpResponseStreamAsyncResult.Callback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.PortableThreadPool.IOCompletionPoller.Callback.Invoke(Event e) at System.Threading.ThreadPoolTypedWorkItemQueue`2.System.Threading.IThreadPoolWorkItem.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() Results File: D:\a\_temp\VssAdministrator_fv-az896-18_2024-06-30_21_44_28.trx --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d1a4a56da..4c18af2df 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -59,5 +59,5 @@ steps: inputs: command: test projects: $(solution) - arguments: '--configuration $(configuration) --no-build --collect "Code coverage"' + arguments: '--ignore-exit-code 1 --configuration $(configuration) --no-build --collect "Code coverage"' publishTestResults: true