Skip to content

Flaky integration/microvm goleak after multibuild tests #2016

Closed

Description

@jbeda

Failure

task test on the locally rebased PR #2013 candidate (base ce948582151971c7128fef13d29c90078ddd9f1c) intermittently fails integration/microvm at package exit after tests report PASS:

goleak: Errors on successful test run: found unexpected goroutines
net.(*pipe).read
.../environment/microvm/control.serveMultiplex
.../environment/microvm/guestagent.(*RepositoryServer).ServeAuthenticated
.../integration/microvm/multibuild_test.go:113
.../environment/microvm/control.(*Client).readLoop

The remaining goroutines are the two ends of a guest net.Pipe created by multiBuildBackend.dial in integration/microvm/multibuild_test.go:104-116. The package's TestMain calls goleak.VerifyTestMain (integration/microvm/leakmain_test.go:9). The full suite runs module tasks concurrently.

Reproduction and controls

  • task test on the rebased candidate: exit 201; this goleak was one of the failures.
  • go test ./integration/microvm -count=1 on the candidate: pass.
  • go test -count=20 ./integration/microvm on origin/main at ce9485821: pass.
  • Focused candidate integration/microvm tests, including the multibuild cases, and targeted go test -race with the package: pass.
  • Our only change to this moved fixture counts canonical EvToolResult rather than both canonical and live availability results in assertRunEvents; it does not change pipe setup or teardown. The observed leak has not been causally attributed to that line.

Expected

All guest/client ends are closed and reader goroutines join before TestMain leak verification, including when tests run alongside other modules. Use deterministic synchronization/cleanup checks rather than increasing goleak grace periods. No live VM or network is required for this fixture.

Relates to #2013

Activity

  1. added
    flake
    on Sep 30, 2026
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

    flake

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions