microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.45k stars 2.6k forks source link

"Publish Test Results" Fails Successfully causing non-deterministic behavior #17635

Closed mastrzyz closed 1 year ago

mastrzyz commented 1 year ago

Note

Issues in this repo are for tracking bugs, feature requests and questions for the tasks in this repo

For a list:
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

If you have an issue or request for the Azure Pipelines service, use developer community instead:

https://developercommunity.visualstudio.com/spaces/21/index.html )

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Bug

Enter Task Name: PublishTestResultsV2

list here (V# not needed): 2.210.0 https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

Private - Windows

What's not working?

Please include error messages and screenshots. The publish test results step is failing in publishing test results -> ##[warning]Failed to publish test results: Error while copying content to a stream. image

This does not lead to a step failure and is very confusing for our post-processing scripts ->

image

Troubleshooting

Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting

Agent and Worker's Diagnostic Logs


2023-01-19T15:29:51.8777085Z ##[section]Starting: Publish Test Results
2023-01-19T15:29:51.8787186Z ==============================================================================
2023-01-19T15:29:51.8787597Z Task         : Publish Test Results
2023-01-19T15:29:51.8787865Z Description  : Publish test results to Azure Pipelines
2023-01-19T15:29:51.8788171Z Version      : 2.210.0
2023-01-19T15:29:51.8788415Z Author       : Microsoft Corporation
2023-01-19T15:29:51.8788692Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results
2023-01-19T15:29:51.8789063Z ==============================================================================
2023-01-19T15:29:52.9015872Z ##[debug]Invoking Method: System.Threading.Tasks.Task <RunAsync>b__9(). Attempt count: 0
2023-01-19T15:29:52.9211993Z ##[debug]Using node path: /usr/local/vss-agent/2.214.1/externals/node10/bin/node
2023-01-19T15:29:53.0715506Z ##[debug]Handler: /__a/externals/node10/bin/node
2023-01-19T15:29:53.0718817Z ##[debug]HandlerArg: /__w/_tasks/PublishTestResults_0b0f01ed-7dde-43ff-9cbb-e48954daf9b1/2.210.0/publishtestresults.js
2023-01-19T15:29:53.0721361Z ##[debug]HandlerWorkDir: /__w/1/s
2023-01-19T15:29:53.2107176Z ##[debug]44 results
2023-01-19T15:29:53.2108304Z ##[debug]found 44 paths
2023-01-19T15:29:53.2109458Z ##[debug]applying include pattern
2023-01-19T15:29:53.2110814Z ##[debug]43 matches
2023-01-19T15:29:53.2111929Z ##[debug]43 final results
2023-01-19T15:29:53.2113087Z ##[debug]Detected 43 test result files
2023-01-19T15:29:53.2114361Z ##[debug]which 'dotnet'
2023-01-19T15:29:53.2115601Z ##[debug]found: '/usr/bin/dotnet'
2023-01-19T15:29:53.2116827Z ##[debug]which '/usr/bin/dotnet'
2023-01-19T15:29:53.2118034Z ##[debug]found: '/usr/bin/dotnet'
2023-01-19T15:29:53.2118950Z Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
2023-01-19T15:29:53.2119724Z   https://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
2023-01-19T15:29:53.2120873Z ##[debug]/usr/bin/dotnet arg: --version
2023-01-19T15:29:53.2122117Z ##[debug]exec tool: /usr/bin/dotnet
2023-01-19T15:29:53.2123302Z ##[debug]arguments:
2023-01-19T15:29:53.2124461Z ##[debug]   --version
2023-01-19T15:29:53.2125552Z [command]/usr/bin/dotnet --version
2023-01-19T15:29:53.2126910Z ##[debug]PublishTestResults.OverrideExeFlow=undefined
2023-01-19T15:29:53.2128108Z ##[debug]OS type: Linux
2023-01-19T15:29:53.9465028Z ##[debug]TestManagement.Server.UsePublishTestResultsLibInAgent is off
2023-01-19T15:30:05.4483105Z ##[debug]TestManagement.PTR.CalculateTestRunSummary is on
2023-01-19T15:30:05.4561376Z ##[debug]Reading test results from file '/mnt/vss/_work/1/s/logs/test-results/e2e/ap-report11.xml'
2023-01-19T15:30:05.4979104Z ##[debug]task result: Succeeded
2023-01-19T15:30:05.4981126Z ##[debug]Processed: ##vso[task.complete result=Succeeded;]
2023-01-19T15:30:05.4982411Z ##[debug]Release.ReleaseUri=undefined
2023-01-19T15:30:05.4983812Z ##[debug]Release.ReleaseId=undefined
2023-01-19T15:30:05.4985042Z ##[debug]Build.BuildUri=vstfs:///Build/Build/18124012
2023-01-19T15:30:05.4986339Z ##[debug]Build.Buildid=18124012
2023-01-19T15:30:05.5224339Z ##[debug]Processed: ##vso[telemetry.publish area=TestExecution;feature=PublishTestResultsTask]{"builduri":"vstfs:///Build/Build/18124012","buildid":"18124012","osType":"Linux","testRunner":"JUnit","failTaskOnFailedTests":"false","mergeResultsUserPreference":"true","config":"Tests","platform":"teams-modular-packages-pr","testResultsFilesCount":43,"dotnetVersion":"","subFeature":"publishTestResultsTaskConsolidatedCiEvent"}
2023-01-19T15:30:05.5226656Z ##[debug]Handler exit code: 0
2023-01-19T15:30:05.5228974Z ##[debug]PERF: RetryHelper Method:System.Threading.Tasks.Task <RunAsync>b__9() : took 12621.2916 ms
2023-01-19T15:30:05.5229751Z ##[debug]PERF WARNING: RetryHelper Method:System.Threading.Tasks.Task <RunAsync>b__9() : took 12621.2916 ms
2023-01-19T15:30:05.5251251Z ##[section]Async Command Start: Publish test results
2023-01-19T15:30:05.8678242Z Publishing test results to test run '159632349'
2023-01-19T15:30:05.8678828Z Test results remaining: 237. Test run id: 159632349
2023-01-19T15:31:13.2619439Z ##[warning]Failed to publish test results: Error while copying content to a stream.
Unable to read data from the transport connection: Broken pipe.
2023-01-19T15:31:13.8467472Z ##[debug]TestManagement.Server.TriggerCoverageMergeJob is on
2023-01-19T15:31:13.8514698Z ##[section]Async Command End: Publish test results
2023-01-19T15:31:13.8516330Z ##[section]Finishing: Publish Test Results
github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days