Skip to content

[Docs]: Document how the "go test ./..." behaves when multiple test binaries are executed  #809

Closed
@mdelapenya

Description

@mdelapenya

Proposal

Context: https://testcontainers.slack.com/archives/C1SUBPZK6/p1674670070385259

go test works creating a test binary for each package if used with ./... . Therefore, each test binary (for each package to be tested) is isolated from the rest packages. Because of that, those test binaries do not share the state of the existing mutexes or any other thing that is synchronised: as it's in the case for the code that reuses or creates the reaper container, or the reuse container feature (we still have to revisit that, reusing the container by request hash).

This behaviour is how go test works, and we should stand with that, not allowing different go packages to access the state created by other packages.

Repro scenario: https://github.com/hahuang65/foo

Thanks to @hahuang65 for the use case and the repro.

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

    documentationDocs, docs, docs.hacktoberfestPull Requests accepted for Hacktoberfest.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions