]> Cypherpunks repositories - gostls13.git/commit
internal/trace: add generator tests for sync events
authorFelix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Fri, 28 Feb 2025 16:30:54 +0000 (17:30 +0100)
committerGopher Robot <gobot@golang.org>
Wed, 21 May 2025 15:23:41 +0000 (08:23 -0700)
commit07b94b2db23eda9ff4629cd8c2a0a32decdae08b
treeb5c03baf18b62d560fd7c96511bb29000f564237
parentb22da3f544418aa4d962848cab9e3458a1fe075b
internal/trace: add generator tests for sync events

Add generator tests that verify the timestamps for the sync events
emitted in the go1.25 trace format and earlier versions.

Add the ability to configure the properties of the per-generation sync
batches in testgen. Also refactor testgen to produce more realistic
timestamps by keeping track of lastTs and using it for structural
batches that don't have their own timestamps. Otherwise they default to
zero which means the minTs of the generation can't be controlled.

For #69869

Change-Id: I92a49b8281bc4169b63e13c030c1de7720cd6f26
Reviewed-on: https://go-review.googlesource.com/c/go/+/653876
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/internal/trace/internal/testgen/trace.go
src/internal/trace/reader_test.go
src/internal/trace/testdata/generators/go123-sync.go [new file with mode: 0644]
src/internal/trace/testdata/generators/go125-sync.go [new file with mode: 0644]
src/internal/trace/testdata/tests/go123-sync.test [new file with mode: 0644]
src/internal/trace/testdata/tests/go125-sync.test [new file with mode: 0644]