Skip to content

Make HttpStress fail on unobserved exceptions #115849

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

Merged
merged 1 commit into from
May 23, 2025

Conversation

antonfirsov
Copy link
Member

There were no unobserved exceptions in recent HttpStress runs, so it should be OK (and desired) to fail the test run if we detect one.

@Copilot Copilot AI review requested due to automatic review settings May 21, 2025 21:05
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the HttpStress test behavior to fail the test run if any unobserved exceptions occur.

  • Updated the exit condition to check for both stress errors and unobserved exceptions.
  • Added a new log message in PrintUnobservedExceptions to indicate when no unobserved exceptions are detected.
Comments suppressed due to low confidence (1)

src/libraries/System.Net.Http/tests/StressTests/HttpStress/Program.cs:247

  • Ensure that s_unobservedExceptions is a thread-safe collection, as its Count property is used in a conditional check which could be subject to race conditions in a concurrent test environment.
return client?.TotalErrorCount == 0 && s_unobservedExceptions.Count == 0 ? ExitCode.Success : ExitCode.StressError;

Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@antonfirsov
Copy link
Member Author

/azp run runtime-libraries stress-http

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@antonfirsov
Copy link
Member Author

/ba-g failures in the runtime pipeline are unrelated

@antonfirsov antonfirsov merged commit fa1604a into dotnet:main May 23, 2025
86 of 89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants