Skip to content

Test flakiness: MeterReadingControllerTest.shouldReturn200WhenExists (Spring context bootstrap) #132

Description

@dfcoffin

Summary

MeterReadingControllerTest.shouldReturn200WhenExists exhibits Spring-context-bootstrap flakiness: it failed once in CI on PR #116 and passed on retry with no code change.

Distinct from #78 (cross-platform timestamp-resolution flakiness) — this one is context-bootstrap timing, not timestamp precision.

Action

  • Reproduce (run the test repeatedly, e.g. mvn test -pl openespi-datacustodian -Dtest=MeterReadingControllerTest#shouldReturn200WhenExists -Dsurefire.rerunFailingTestsCount=0 in a loop).
  • Identify the bootstrap race — likely shared mutable context state, @MockBean re-init, or an ordering dependency between tests in the class.
  • Fix the root cause (proper test isolation / @DirtiesContext only if unavoidable), not by adding blanket retries.

Acceptance criteria

  • Root cause identified and documented
  • Test passes deterministically across repeated runs
  • No reliance on CI retry to go green

Source

PR_116_FOLLOWUP_NOTES.md item 4 (post-PR #116, 2026-05-19).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginfrastructureCI, build, deployment, or developer tooling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions