Skip to content

Fix weaver live-check RemoteDisconnected by reading report from stdout - #5519

Draft
emdneto with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-opentelemetry-test-utils-failure
Draft

Fix weaver live-check RemoteDisconnected by reading report from stdout#5519
emdneto with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-opentelemetry-test-utils-failure

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Weaver v0.22.1 exits ~1 second after processing all received OTLP data. The previous implementation retrieved the JSON report via HTTP response to POST /stop, but by the time weaver.end() called _do_stop(), weaver had already shut down its HTTP server — causing RemoteDisconnected and a test failure in test_end_with_violations.

Changes

  • Remove --output=http from the weaver command. Per weaver docs, the default behavior writes the JSON report to stdout on exit.
  • Add --no-stream so the complete report is emitted as a single JSON document at shutdown rather than streamed piecemeal.
  • Rewrite _do_stop: POST /stop is still sent to trigger an orderly shutdown, but connection errors are silently ignored (weaver may have already exited). The report is always read from stdout after process exit.
  • Update _read_weaver_logs to read only stderr — stdout now contains the structured JSON report, not human-readable logs.
  • Add a warning when weaver produces no stdout output so silent failures surface.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

The existing test suite in tests/opentelemetry-test-utils/tests/test_weaver_live_check.py covers this — specifically TestSDKInitLiveCheck::test_end_with_violations, which was the failing test.

  • Existing weaver live-check tests

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

When weaver v0.22.1 exits quickly after processing OTLP data, the
POST to /stop gets a RemoteDisconnected error because weaver has
already shut down its HTTP server.

Fix: remove --output=http so weaver writes the JSON report to stdout
on exit (default behavior). Add --no-stream to produce the full
report as one JSON document. Rewrite _do_stop to signal /stop
(ignoring connection errors), wait for process exit, then read
the report from stdout. Update _read_weaver_logs to only read
stderr since stdout now contains the JSON report.

Assisted-by: Claude Sonnet 4.6

Co-authored-by: emdneto <9735060+emdneto@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job for opentelemetry-test-utils Fix weaver live-check RemoteDisconnected by reading report from stdout Aug 7, 2026
Copilot AI requested a review from emdneto August 7, 2026 13:00
Co-authored-by: emdneto <9735060+emdneto@users.noreply.github.com>
@emdneto

emdneto commented Aug 7, 2026

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

Co-authored-by: emdneto <9735060+emdneto@users.noreply.github.com>

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in 29c7db6. The conflict was in _do_stop — kept the stdout-based report reading approach (our fix) and discarded the conflicting --output=http code from main.

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.

2 participants