Skip to content

Fix flaky TestDPEAndACSConnFailureTrackerTracking nil pointer panic - #4993

Merged
danehlim merged 1 commit into
aws:devfrom
amogh09:amoghr/fix-flaky-acs-test
Jun 5, 2026
Merged

danehlim merged 1 commit into
aws:devfrom
amogh09:amoghr/fix-flaky-acs-test

Conversation

@amogh09

@amogh09 amogh09 commented Jun 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fix flaky TestDPEAndACSConnFailureTrackerTracking that intermittently panics with nil pointer dereference in CI.

Implementation details

The test's session struct was missing backoff and timeout fields. In the "DPE success and ACS connect success" subcase, startSessionOnce reaches startACSSession, which creates a backoffResetTimer via time.AfterFunc(AddJitter(s.heartbeatTimeout, s.heartbeatJitter), ...). With both timeout fields at zero, the timer fires immediately in a separate goroutine. If that goroutine runs before the deferred cancel(), it calls s.backoff.Reset() on a nil pointer — crashing the test binary.

The fix adds heartbeatTimeout, heartbeatJitter, disconnectTimeout, disconnectJitter, and backoff to the session struct in the test, matching the pattern used by all other tests in the file.

Testing

  • Reproduced the panic locally with -count=500 (hit within ~100 iterations)
  • Verified fix passes 500 iterations without panic
  • Verified fix passes 500 iterations with -race detector
  • Full ACS session test suite passes

New tests cover the changes: no (this fixes an existing test)

Description for the changelog

  • Bugfix - Fix flaky TestDPEAndACSConnFailureTrackerTracking nil pointer panic caused by missing session fields

Additional Information

Does this PR include breaking model changes? If so, Have you added transformation functions?
No

Does this PR include the addition of new environment variables in the README?
No

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The test's session struct was missing backoff and timeout fields, causing
a nil pointer dereference when the backoff reset timer fired in a
separate goroutine during the success test case.
@amogh09
amogh09 marked this pull request as ready for review June 5, 2026 19:34
@amogh09
amogh09 requested a review from a team as a code owner June 5, 2026 19:34
@danehlim
danehlim merged commit ebcc0a8 into aws:dev Jun 5, 2026
45 of 47 checks passed
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.

4 participants