[Infra] Fix hanging tests

Merged
MA
3mo ago
+619-356

Changes

  • Fix OTLP transmission handlers not being disposed, which could keep threads alive in the background and cause the coverage collection to never complete and hang the test host.
  • Fix undisposed resources if logger, meter or tracer provider threw an exception in its constructor, which would also keep coverage collection alive in CI from tests that tested throwing behaviours.
  • Fix race condition that could cause the Prometheus scrape endpoint to report HTTP 200 instead of 408 under load.
  • Fix a flaky HTTP retry test.
  • Fix CI being treated as successful if a job timed-out and was cancelled.
  • Increase VSTEST_CONNECTION_TIMEOUT to allow for additional time required to instrument the GAC for code coverage when targeting net462.
  • Exclude test loggers from code coverage as they could cause the VSTest process to hang.
  • Add a timeout to test container start-up and dispose.
  • Remove redundant port binding.
  • Do not wait indefinitely for Prometheus test container logs.
  • Collect hang dumps from tests.
  • Add a timeout to the test step and the test session.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)