Skip to content

test(network): re-add Test_conn_startSending with deterministic ordering - #4433

Closed
stevenvegt wants to merge 16 commits into
masterfrom
fix/flaky-conn-test-v6.2
Closed

test(network): re-add Test_conn_startSending with deterministic ordering#4433
stevenvegt wants to merge 16 commits into
masterfrom
fix/flaky-conn-test-v6.2

Conversation

@stevenvegt

Copy link
Copy Markdown
Member

Summary

Re-adds Test_conn_startSending/disconnect_does_not_panic, which was removed in #2618 because it was flaky. The flake was one over-specified assertion: the test cancelled the stream before calling disconnect(), racing the receive goroutine (which stores the stream error as close status) against disconnect() cancelling the connection context.

Disconnecting first makes the test deterministic and restores coverage for goroutine exit and the disconnect panic guard (#1017). Companion PRs: same re-add on V6.2, reorder-only fix on V5.4 (which still had the racy version and flaked on #4425).

Verified with go test -race -count=100: 100/100 pass.

Assisted-by: AI

reinkrul and others added 16 commits March 25, 2026 08:36
* Bump github.com/nats-io/nats-server/v2 from 2.11.12 to 2.11.15 (#4107)

Bumps [github.com/nats-io/nats-server/v2](https://github.com/nats-io/nats-server) from 2.11.12 to 2.11.15.
- [Release notes](https://github.com/nats-io/nats-server/releases)
- [Changelog](https://github.com/nats-io/nats-server/blob/main/RELEASES.md)
- [Commits](nats-io/nats-server@v2.11.12...v2.11.15)

---
updated-dependencies:
- dependency-name: github.com/nats-io/nats-server/v2
  dependency-version: 2.11.15
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Release notes for v6.2.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes GO-2026-4865 (html/template XSS), GO-2026-4866 (crypto/x509 auth bypass),
GO-2026-4869 (archive/tar DoS), GO-2026-4870 (crypto/tls DoS), GO-2026-4946 (crypto/x509 DoS)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
The v1 introspection endpoint accepted any JWT signed by a key present on
the node, allowing VP JWTs to be replayed as access tokens. This adds three
validation checks to IntrospectAccessToken:

- Require typ header to be "at+jwt" (set on issuance, verified on introspection)
- Require non-empty iss, sub, and service claims
- Verify iss claim matches the DID extracted from the kid header

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add v6.2.3 release notes

---------

Co-authored-by: Steven van der Vegt <steven.vandervegt@s-curve.nl>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Probably due to a new version of vault, the e2e test failed. Vault tried to set setcap in vault container for CI compatibility which is not allowed by the CI runner.

Created the correct container dependencies and skip the setcap for vault fixed the problem.

Co-authored-by: Steven van der Vegt <steven.vandervegt@s-curve.nl>
Updates go-stoabs from v1.11.0 to v1.11.1, which removes an unnecessary
Go-level read lock from the BBolt wrapper. The read lock caused reader
starvation (context deadline exceeded) when a write transaction was pending,
preventing network notifiers from starting on nodes with slow disk I/O
(e.g. SMB/Azure Files volume mounts).

Backport of #4170 to V6.2.

Fixes #4162

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Bump alpine from 3.23.3 to 3.23.4 (#4203)

Bumps alpine from 3.23.3 to 3.23.4.

---
updated-dependencies:
- dependency-name: alpine
  dependency-version: 3.23.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add v6.2.5 release notes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…2.5) (#4239)

* Upgrade Go to 1.26.3 and golang.org/x/net to v0.53.0 to fix CVEs (v6.2.6)

Assisted by AI

* Fold CVE fixes into pending v6.2.5 release

v6.2.5 was prepared (alpine bump) but never tagged. Combine with the
Go and golang.org/x/net upgrades and ship under v6.2.5 rather than
introducing a v6.2.6 gap.

Assisted by AI
* Exclude retraction presentations from Discovery Service search (#4193)

Retraction markers are stored on the timeline so Get() can replicate
them, but must not surface from Search(). With an empty query, no
credential join was applied, so retraction VPs (which have no
credentials) were returned to API callers.

Fixes #4192

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Make HTTPErrorHandler idempotent on committed responses (#4243)

Echo's BodyDump middleware (used when http.log: metadata-and-body) calls
c.Error(err) on its way out and still returns the err, so echo's server
loop invokes HTTPErrorHandler a second time for the same request. The
first invocation wrote the response correctly; the second logged the
operation error a second time and warned "Unable to send error back to
client, response already committed" — visible noise without a real
problem. echo.DefaultHTTPErrorHandler short-circuits on Committed=true;
ours did not. Mirror that behavior.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Add v6.2.6 release notes

Assisted by AI

* Update release_notes.rst

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Steven van der Vegt <steven.vandervegt@s-curve.nl>
…ters to fix CVEs (v6.2.7) (#4282)

* Upgrade golang.org/x/crypto and golang.org/x/net to fix CVEs (v6.2.7)

- golang.org/x/crypto v0.50.0 -> v0.52.0 (GO-2026-5018)
- golang.org/x/net v0.53.0 -> v0.55.0 (GO-2026-5026)

Assisted by AI

* Upgrade go-jose and OTLP HTTP exporters to fix CVEs (v6.2.7)

- github.com/go-jose/go-jose/v4 v4.1.3 -> v4.1.4 (GO-2026-4945)
- go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.16.0 -> v0.19.0 (GO-2026-4985)
- go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.42.0 -> v1.43.0 (GO-2026-4985)

Assisted by AI
Backport of #4250 and #4259 from master, limited to CI:

- add .github/workflows/go-test.yaml, remove .circleci/config.yml
- build-images: build only linux/amd64 on PRs, multi-arch on push/tag
- e2e-tests: enable GHA layer cache
- drop brittle DNS-error / readdir-order test assertions exposed by the
  ubuntu-latest runner (same fixes as #4250) so go-test passes

Assisted by AI
…g down (#4276) (#4381)

Test_grpcConnectionManager_Peers/inbound_stream_triggers_observer and the
mirror outbound subtest set Authenticate expectations on both peer's
authenticator mocks but only waited for one side's observer to fire before
calling cm2.Stop(). When the observed side won the race, the other side's
authenticator could still be in flight when t.Cleanup ran gomock's Finish(),
reporting a missing call.

Extend the wait condition to also require the unobserved side's Peers() list
to be populated, which only happens after that side's Authenticate returns.

Assisted-by: AI

Co-authored-by: Steven van der Vegt <steven.vandervegt@s-curve.nl>
The test was removed on master in #2618 because it was flaky: it
cancelled the stream before calling disconnect(), racing the receive
goroutine (which stores the stream error as close status) against
disconnect() cancelling the connection context. Disconnecting first
guarantees the context is cancelled before RecvMsg returns, making the
test deterministic while restoring the goroutine-exit and no-panic
coverage. Verified with -race -count=100.

Assisted-by: AI
@stevenvegt

Copy link
Copy Markdown
Member Author

Wrong head branch (created from the V6.2 fix branch); replaced by a PR from fix/flaky-conn-test-master.

@stevenvegt stevenvegt closed this Jul 27, 2026
@qltysh

qltysh Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

22 new issues

Tool Category Rule Count
qlty Structure Function with many returns (count = 7): introspectAccessToken 22

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