Skip to content

runtime: TestGcSys does not really pass, should be fixed or removed #23343

Closed
@ianlancetaylor

Description

@ianlancetaylor

The runtime test TestGcSys no longer tests anything. The test simply checks whether the function GCSys in runtime/testdata/testprog/gc.go prints OK. It currently passes because the helper function workthegc is inlined and the compiler discards the allocation of the slice. If I change the code slightly to add //go:noinline before workthegc, the test fails, saying using too much memory: 64086016 bytes (the exact number of bytes reported varies).

We should either discard the test or fix it so that it actually tests something about the GC.

(I noticed this because the test fails consistently using gccgo, which does not currently discard the slice allocation.)

CC @aclements @RLH

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions