Skip to content

Commit

Permalink
fix(cmd/gno): reset runtime metrics allocator on each test run (#3394)
Browse files Browse the repository at this point in the history
Ensures that the `allocs` printed by `-print-runtime-metrics` are
per-test, like the cycles.

h/t @leohhhn

Co-authored-by: Leon Hudak <33522493+leohhhn@users.noreply.github.com>
  • Loading branch information
2 people authored and albttx committed Jan 10, 2025
1 parent 5a6c71b commit 4a9af36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gnovm/pkg/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func (opts *TestOptions) runTestFiles(
// RunFiles doesn't do that currently)
// - Wrap here.
m = Machine(gs, opts.Output, memPkg.Path)
m.Alloc = alloc
m.Alloc = alloc.Reset()
m.SetActivePackage(pv)

testingpv := m.Store.GetPackage("testing", false)
Expand Down

0 comments on commit 4a9af36

Please sign in to comment.