Clarify lazy runtime Close concurrency semantics - #75
Conversation
Document the conservative Close-vs-first-use invariant and add race-friendly lazy state tests so the edge case remains stable. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Code Review
This pull request updates the documentation for LazyEmulator and LazyRuntime to clarify their concurrent lifecycle invariants, specifically detailing how concurrent initialization (Get/Setup) and cleanup (Close) are serialized. Additionally, it introduces new unit tests in lazy_test.go to verify these behaviors, including edge cases like closing after a panic, closing before initialization, and concurrent get and close operations. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Fixes #39.
Test plan
go test -race -run 'TestLazy' ./...TESTCONTAINERS_RYUK_DISABLED=true go test -race ./...git diff --checkMade with Cursor