Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/genspec-tui/internal/ux/scan/profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ func TestProfilerDisabled(t *testing.T) {
}

func TestProfilerCapturesARun(t *testing.T) {
// At the default rate the heap profiler samples one allocation per 512 KiB, so a megabyte of test allocations is a
// Poisson draw with a mean of two: it comes back empty about one run in seven, whatever the machine or the
// toolchain. Counting every allocation makes the assertion below about attribution rather than about luck, and the
// runtime honours rate 1 from the next allocation - there is no threshold left over from the old rate.
countEveryAllocation(t)

dir := t.TempDir()

p := newProfiler(Profiling{Enabled: true, Dir: dir})
Expand Down
Loading