diff --git a/src/internal/trace/export_reader_test.go b/src/internal/trace/export_reader_test.go new file mode 100644 index 0000000000..042c70864c --- /dev/null +++ b/src/internal/trace/export_reader_test.go @@ -0,0 +1,12 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package trace + +import "internal/trace/version" + +// GoVersion is the version set in the trace header. +func (r *Reader) GoVersion() version.Version { + return r.version +} diff --git a/src/internal/trace/reader_test.go b/src/internal/trace/reader_test.go index 691cda6688..39ae77471e 100644 --- a/src/internal/trace/reader_test.go +++ b/src/internal/trace/reader_test.go @@ -11,6 +11,7 @@ import ( "io" "os" "path/filepath" + "runtime" "strings" "testing" "time" @@ -109,6 +110,10 @@ func testReader(t *testing.T, tr io.Reader, v *testtrace.Validator, exp *testtra if err == io.EOF { break } + v.GoVersion = r.GoVersion() + if runtime.GOOS == "windows" || runtime.GOARCH == "wasm" { + v.SkipClockSnapshotChecks() + } if err != nil { if err := exp.Check(err); err != nil { t.Error(err)