Skip to content

Wait for HTTPS listener readiness in integration tests - #4313

Open
marcschier with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-republish-compact-over-real-https-listener
Open

Wait for HTTPS listener readiness in integration tests#4313
marcschier with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-republish-compact-over-real-https-listener

Conversation

Copilot AI commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Description

The real HTTPS listener test could issue its first request before Kestrel accepted connections, causing intermittent macOS failures.

  • Listener readiness
    • Probe the loopback port after OpenAsync.
    • Retry connection failures every 25 ms with a 10-second deadline.
    • Create the test client only after the listener accepts TCP connections.

Related Issues

Checklist

  • I have signed the CLA and read the CONTRIBUTING doc.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added all necessary documentation.
  • I have verified that my changes do not introduce (new) build or analyzer warnings.
  • I ran all tests locally using the UA.slnx solution against at least .net framework and .net 10, and all passed.
  • I fixed all failing and flaky tests in the CI pipelines and all CodeQL warnings.
  • I have addressed all PR feedback received.

@CLAassistant

CLAassistant commented Aug 25, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ marcschier
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix flakiness in RepublishCompactOverRealHttpsListener on macOS Wait for HTTPS listener readiness in integration tests Aug 25, 2026
Copilot AI requested a review from marcschier August 25, 2026 22:23
@marcschier
marcschier marked this pull request as ready for review August 25, 2026 22:31
Copilot AI lite review requested due to automatic review settings August 25, 2026 22:31
@marcschier

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 hardens the RealHttpsListenerIntegrationTests fixture by ensuring the Kestrel-backed HTTPS listener is actually accepting TCP connections before the first test request is sent, addressing an intermittent macOS flake in the real HTTPS round-trip tests.

Changes:

  • Added a post-OpenAsync readiness probe that attempts loopback TCP connects until the listener accepts or a deadline is reached.
  • Deferred HttpClient creation until after listener readiness is confirmed.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown

Code coverage

Coverage gate passed.

Check Result Threshold
✅ Project line rate 86.14% (233344/270884 lines) >= 70.00%
✅ Project branch rate 75.60% >= 60.00%
ℹ️ Patch coverage no changed C# files -
ℹ️ Baseline delta (advisory) +12.54 pp 73.60% recorded

Coverage is above the recorded baseline - consider ratcheting coverage-thresholds.json.

Thresholds live in coverage-thresholds.json. Whole report before exclusions: line 85.51%, branch 75.05%.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.30%. Comparing base (cb50353) to head (99bb998).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4313      +/-   ##
==========================================
- Coverage   80.30%   80.30%   -0.01%     
==========================================
  Files        1927     1927              
  Lines      263492   263492              
  Branches    46101    46101              
==========================================
- Hits       211597   211590       -7     
- Misses      35650    35669      +19     
+ Partials    16245    16233      -12     
Flag Coverage Δ
actions 80.30% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@marcschier

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@marcschier

Copy link
Copy Markdown
Collaborator

@copilot fix ci

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix ci

Fixed in 99bb998 by removing the unused exception variable that caused CS0168 in the HTTPS WebApi test build. Targeted dotnet test tests/Opc.Ua.Bindings.Https.WebApi.Tests/Opc.Ua.Bindings.Https.WebApi.Tests.csproj -f net10.0 --no-restore passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opc.Ua.Bindings.Https.WebApi.Tests: RepublishCompactOverRealHttpsListener flakes on macOS

5 participants