]> Cypherpunks repositories - gostls13.git/commitdiff
internal/trace: add Go 1.19 test data
authorRhys Hiltner <rhys@justin.tv>
Thu, 23 Jun 2022 16:43:47 +0000 (09:43 -0700)
committerRhys Hiltner <rhys@justin.tv>
Fri, 24 Jun 2022 22:08:17 +0000 (22:08 +0000)
Update instructions to match what seems to be the historical practice:
to generate canned traces when a version is finalized, rather than
waiting until it is superseded.

Follow rename of trace-internal tests from "Span" to "Region". Update
the net/http test invocation to match the apparent intent and the actual
http_1_5_good behavior (about 7ms of total run time and trace file size
under 50kB).

Change-Id: Ifd4c85882159478852e0b8f0d771b6f16b8f3c1b
Reviewed-on: https://go-review.googlesource.com/c/go/+/413776
Run-TryBot: Rhys Hiltner <rhys@justin.tv>
Reviewed-by: Carlos Amedee <carlos@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/internal/trace/mkcanned.bash
src/internal/trace/parser.go
src/internal/trace/testdata/http_1_19_good [new file with mode: 0644]
src/internal/trace/testdata/stress_1_19_good [new file with mode: 0644]
src/internal/trace/testdata/stress_start_stop_1_19_good [new file with mode: 0644]
src/internal/trace/testdata/user_task_region_1_11_good [moved from src/internal/trace/testdata/user_task_span_1_11_good with 100% similarity]
src/internal/trace/testdata/user_task_region_1_19_good [new file with mode: 0644]

index b365b909c8cf5e986178720afeb1c898cf5d5742..879cf1c500fce079017de2f282ffe1d91a81581a 100755 (executable)
@@ -13,8 +13,8 @@ if [ $# != 1 ]; then
     exit 1
 fi
 
-go test -run ClientServerParallel4 -trace "testdata/http_$1_good" net/http
-go test -run 'TraceStress$|TraceStressStartStop$|TestUserTaskSpan$' runtime/trace -savetraces
+go test -run '^$' -bench ClientServerParallel4 -benchtime 10x -trace "testdata/http_$1_good" net/http
+go test -run 'TraceStress$|TraceStressStartStop$|TestUserTaskRegion$' runtime/trace -savetraces
 mv ../../runtime/trace/TestTraceStress.trace "testdata/stress_$1_good"
 mv ../../runtime/trace/TestTraceStressStartStop.trace "testdata/stress_start_stop_$1_good"
-mv ../../runtime/trace/TestUserTaskSpan.trace "testdata/user_task_span_$1_good"
+mv ../../runtime/trace/TestUserTaskRegion.trace "testdata/user_task_region_$1_good"
index 8c74196ddf197ec5f48a5f3e823376675c1591ed..866fe8cdd9e10f5c31a92c5642d9e0ba4d4a4e73 100644 (file)
@@ -152,8 +152,8 @@ func readTrace(r io.Reader) (ver int, events []rawEvent, strings map[uint64]stri
        }
        switch ver {
        case 1005, 1007, 1008, 1009, 1010, 1011, 1019:
-               // Note: When adding a new version, add canned traces
-               // from the old version to the test suite using mkcanned.bash.
+               // Note: When adding a new version, confirm that canned traces from the
+               // old version are part of the test suite. Add them using mkcanned.bash.
                break
        default:
                err = fmt.Errorf("unsupported trace file version %v.%v (update Go toolchain) %v", ver/1000, ver%1000, ver)
diff --git a/src/internal/trace/testdata/http_1_19_good b/src/internal/trace/testdata/http_1_19_good
new file mode 100644 (file)
index 0000000..c1d519e
Binary files /dev/null and b/src/internal/trace/testdata/http_1_19_good differ
diff --git a/src/internal/trace/testdata/stress_1_19_good b/src/internal/trace/testdata/stress_1_19_good
new file mode 100644 (file)
index 0000000..13f5926
Binary files /dev/null and b/src/internal/trace/testdata/stress_1_19_good differ
diff --git a/src/internal/trace/testdata/stress_start_stop_1_19_good b/src/internal/trace/testdata/stress_start_stop_1_19_good
new file mode 100644 (file)
index 0000000..92d9278
Binary files /dev/null and b/src/internal/trace/testdata/stress_start_stop_1_19_good differ
diff --git a/src/internal/trace/testdata/user_task_region_1_19_good b/src/internal/trace/testdata/user_task_region_1_19_good
new file mode 100644 (file)
index 0000000..1daa3b2
Binary files /dev/null and b/src/internal/trace/testdata/user_task_region_1_19_good differ