Skip to content

Commit fb868c6

Browse files
authored
Remove go 1.16 and 1.17. Add Go 1.22 and 1.23 into dynamic tracer test matrix (#2120)
Summary: Remove go 1.16 and 1.17. Add Go 1.22 and 1.23 into dynamic tracer test matrix Once Go 1.16 and 1.17 are removed from the repo, we can pursue go dependency upgrades like #2115. I also added Go 1.22 and 1.23 (the latest versions) to dynamic tracer tests that ideally should cover multiple go versions. Relevant Issues: N/A Type of change: /kind cleanup Test Plan: Existing tests --------- Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent e83d74f commit fb868c6

21 files changed

+166
-283
lines changed

WORKSPACE

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,6 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
211211
gazelle_dependencies(go_sdk = "go_sdk")
212212

213213
# Download alternative go toolchains after all other dependencies, so that they aren't used by external dependencies.
214-
go_download_sdk(
215-
name = "go_sdk_1_16",
216-
version = "1.16.15",
217-
)
218-
219-
go_download_sdk(
220-
name = "go_sdk_1_17",
221-
version = "1.17.13",
222-
)
223-
224214
go_download_sdk(
225215
name = "go_sdk_1_18",
226216
version = "1.18.10",

bazel/pl_build_system.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ load("@rules_python//python:defs.bzl", "py_test")
2424
load("//bazel:toolchain_transitions.bzl", "qemu_interactive_runner")
2525

2626
pl_boringcrypto_go_sdk = ["1.20.13"]
27-
pl_supported_go_sdk_versions = ["1.16", "1.17", "1.18", "1.19", "1.20", "1.21", "1.22", "1.23"]
27+
pl_supported_go_sdk_versions = ["1.18", "1.19", "1.20", "1.21", "1.22", "1.23"]
2828

2929
# The last version in this list corresponds to the boringcrypto go sdk version.
3030
pl_all_supported_go_sdk_versions = pl_supported_go_sdk_versions + pl_boringcrypto_go_sdk

src/stirling/e2e_tests/BUILD.bazel

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ pl_sh_bpf_test(
8888
srcs = ["stirling_wrapper_bpf_test.sh"],
8989
args = [
9090
"$(location //src/stirling/binaries:stirling_wrapper)",
91-
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_16_grpc_server_with_certs)",
92-
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_16_grpc_client)",
91+
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs)",
92+
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client)",
9393
"-stirling_profiler_java_agent_libs %s" % agent_libs_arg,
9494
],
9595
data = [
9696
"//src/stirling/binaries:stirling_wrapper",
97-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_16_grpc_client",
98-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_16_grpc_server_with_certs",
97+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client",
98+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs",
9999
] + agent_libs,
100100
# TODO(PL-1462): Uprobe attaching sometimes fails.
101101
flaky = True,
@@ -132,13 +132,13 @@ pl_sh_bpf_test(
132132
srcs = ["stirling_wrapper_container_bpf_test.sh"],
133133
args = [
134134
"$(location //src/stirling/binaries:stirling_wrapper_image.tar)",
135-
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_16_grpc_server_with_certs)",
136-
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_16_grpc_client)",
135+
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs)",
136+
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client)",
137137
],
138138
data = [
139139
"//src/stirling/binaries:stirling_wrapper_image.tar",
140-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_16_grpc_client",
141-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_16_grpc_server_with_certs",
140+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client",
141+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs",
142142
],
143143
flaky = True,
144144
tags = [

src/stirling/obj_tools/dwarf_reader_test.cc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ constexpr std::string_view kTestGo1_20Binary =
3434
"src/stirling/obj_tools/testdata/go/test_go_1_20_binary";
3535
constexpr std::string_view kTestGo1_21Binary =
3636
"src/stirling/obj_tools/testdata/go/test_go_1_21_binary";
37+
constexpr std::string_view kTestGo1_22Binary =
38+
"src/stirling/obj_tools/testdata/go/test_go_1_22_binary";
39+
constexpr std::string_view kTestGo1_23Binary =
40+
"src/stirling/obj_tools/testdata/go/test_go_1_23_binary";
3741
constexpr std::string_view kGoGRPCServer =
3842
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_19_grpc_tls_server_binary";
3943
constexpr std::string_view kCppBinary = "src/stirling/obj_tools/testdata/cc/test_exe_/test_exe";
@@ -46,6 +50,8 @@ const auto kGo1_18BinaryPath = px::testing::BazelRunfilePath(kTestGo1_18Binary);
4650
const auto kGo1_19BinaryPath = px::testing::BazelRunfilePath(kTestGo1_19Binary);
4751
const auto kGo1_20BinaryPath = px::testing::BazelRunfilePath(kTestGo1_20Binary);
4852
const auto kGo1_21BinaryPath = px::testing::BazelRunfilePath(kTestGo1_21Binary);
53+
const auto kGo1_22BinaryPath = px::testing::BazelRunfilePath(kTestGo1_22Binary);
54+
const auto kGo1_23BinaryPath = px::testing::BazelRunfilePath(kTestGo1_23Binary);
4955
const auto kGoServerBinaryPath = px::testing::BazelRunfilePath(kGoGRPCServer);
5056
const auto kGoBinaryUnconventionalPath = px::testing::BazelRunfilePath(kGoBinaryUnconventional);
5157

@@ -572,7 +578,11 @@ INSTANTIATE_TEST_SUITE_P(GolangDwarfReaderParameterizedTest, GolangDwarfReaderTe
572578
DwarfReaderTestParam{kGo1_20BinaryPath, true},
573579
DwarfReaderTestParam{kGo1_20BinaryPath, false},
574580
DwarfReaderTestParam{kGo1_21BinaryPath, true},
575-
DwarfReaderTestParam{kGo1_21BinaryPath, false}));
581+
DwarfReaderTestParam{kGo1_21BinaryPath, false},
582+
DwarfReaderTestParam{kGo1_22BinaryPath, true},
583+
DwarfReaderTestParam{kGo1_22BinaryPath, false},
584+
DwarfReaderTestParam{kGo1_23BinaryPath, true},
585+
DwarfReaderTestParam{kGo1_23BinaryPath, false}));
576586

577587
INSTANTIATE_TEST_SUITE_P(GolangDwarfReaderParameterizedIndexTest, GolangDwarfReaderIndexTest,
578588
::testing::Values(true, false));

src/stirling/obj_tools/testdata/go/BUILD.bazel

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,17 @@ filegroup(
6969
# These older 32 bit binaries have been the source of bugs, so this test case verifies we don't
7070
# introduce a regression (https://github.com/pixie-io/pixie/issues/1300).
7171
"test_go1_13_i386_binary",
72-
":test_go_1_17_binary",
72+
# This binary was built with go 1.17. This ensures that the 64 bit little endian case buildinfo logic is tested.
73+
# (https://github.com/golang/go/blob/1dbbafc70fd3e2c284469ab3e0936c1bb56129f6/src/debug/buildinfo/buildinfo.go#L192-L208).
74+
# Newer versions of go generate the endian agnostic buildinfo header
75+
# (https://github.com/golang/go/blob/1dbbafc70fd3e2c284469ab3e0936c1bb56129f6/src/debug/buildinfo/buildinfo.go#L189-L190)
76+
# and so it cannot be tested without compiling against an older Go version.
77+
"test_go_1_17_binary",
7378
":test_go_1_18_binary",
7479
":test_go_1_19_binary",
7580
":test_go_1_20_binary",
7681
":test_go_1_21_binary",
82+
":test_go_1_22_binary",
83+
":test_go_1_23_binary",
7784
],
7885
)
1.72 MB
Binary file not shown.

src/stirling/scripts/benchmark_stirling_wrapper_http2_tracing.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ BAZEL_BUILD_CMD="bazel build --compilation_mode=opt"
2424

2525
TEST_EXE_BASE_DIR="bazel-bin/src/stirling/source_connectors/socket_tracer/protocols/http2/testing"
2626

27-
GRPC_CLIENT_LABEL="src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_17_grpc_client"
28-
GRPC_CLIENT_EXE="${TEST_EXE_BASE_DIR}/go_grpc_client/golang_1_17_grpc_client"
27+
GRPC_CLIENT_LABEL="src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_23_grpc_client"
28+
GRPC_CLIENT_EXE="${TEST_EXE_BASE_DIR}/go_grpc_client/golang_1_23_grpc_client"
2929

30-
GRPC_SERVER_LABEL="src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_17_grpc_server"
31-
GRPC_SERVER_EXE="${TEST_EXE_BASE_DIR}/go_grpc_server/golang_1_17_grpc_server"
30+
GRPC_SERVER_LABEL="src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_23_grpc_server"
31+
GRPC_SERVER_EXE="${TEST_EXE_BASE_DIR}/go_grpc_server/golang_1_23_grpc_server"
3232

3333
STIRLING_WRAPPER_LABEL="src/stirling/binaries:stirling_wrapper"
3434
STIRLING_WRAPPER_EXE="bazel-bin/src/stirling/binaries/stirling_wrapper"

src/stirling/source_connectors/dynamic_bpftrace/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ pl_cc_bpf_test(
3838
name = "dynamic_bpftrace_connector_bpf_test",
3939
srcs = ["dynamic_bpftrace_connector_bpf_test.cc"],
4040
data = [
41-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_16_grpc_server_with_certs",
42-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_17_grpc_server_with_certs",
41+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_18_grpc_server_with_certs",
42+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs",
4343
],
4444
tags = [
4545
"cpu:16",

src/stirling/source_connectors/dynamic_bpftrace/dynamic_bpftrace_connector_bpf_test.cc

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -462,23 +462,23 @@ TEST(DynamicBPFTraceConnectorTest, BPFTraceCheckPrintfsError) {
462462
HasSubstr("All printf statements must have exactly the same format string")));
463463
}
464464

465-
constexpr std::string_view kServerPath_1_16 =
465+
constexpr std::string_view kServerPath_1_18 =
466466
"src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/"
467-
"golang_1_16_grpc_server";
468-
constexpr std::string_view kServerPath_1_17 =
467+
"golang_1_18_grpc_server";
468+
constexpr std::string_view kServerPath_1_19 =
469469
"src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/"
470-
"golang_1_17_grpc_server";
470+
"golang_1_19_grpc_server";
471471

472472
TEST(DynamicBPFTraceConnectorTest, InsertUProbeTargetObjPaths) {
473-
std::string go1_16_binary_path = px::testing::BazelRunfilePath(kServerPath_1_16).string();
474-
std::string go1_17_binary_path = px::testing::BazelRunfilePath(kServerPath_1_17).string();
473+
std::string go1_18_binary_path = px::testing::BazelRunfilePath(kServerPath_1_18).string();
474+
std::string go1_19_binary_path = px::testing::BazelRunfilePath(kServerPath_1_19).string();
475475

476-
ASSERT_TRUE(fs::Exists(go1_16_binary_path));
477-
ASSERT_TRUE(fs::Exists(go1_17_binary_path));
476+
ASSERT_TRUE(fs::Exists(go1_18_binary_path));
477+
ASSERT_TRUE(fs::Exists(go1_19_binary_path));
478478

479479
DeploymentSpec spec;
480-
spec.mutable_path_list()->add_paths(go1_16_binary_path);
481-
spec.mutable_path_list()->add_paths(go1_17_binary_path);
480+
spec.mutable_path_list()->add_paths(go1_18_binary_path);
481+
spec.mutable_path_list()->add_paths(go1_19_binary_path);
482482

483483
std::string uprobe_script =
484484
"// Deploys uprobes to trace http2 traffic.\n"
@@ -489,16 +489,16 @@ TEST(DynamicBPFTraceConnectorTest, InsertUProbeTargetObjPaths) {
489489
InsertUprobeTargetObjPaths(spec, &uprobe_script);
490490
EXPECT_EQ(
491491
uprobe_script,
492-
absl::StrCat("// Deploys uprobes to trace http2 traffic.\n", "uprobe:", go1_16_binary_path,
492+
absl::StrCat("// Deploys uprobes to trace http2 traffic.\n", "uprobe:", go1_18_binary_path,
493493
":\"golang.org/x/net/http2.(*Framer).WriteDataPadded\",\n"
494494
"uprobe:",
495-
go1_17_binary_path,
495+
go1_19_binary_path,
496496
":\"golang.org/x/net/http2.(*Framer).WriteDataPadded\""
497497
"{ printf(\"stream_id: %d, end_stream: %d\", arg0, arg1); }\n",
498-
"uretprobe:", go1_16_binary_path,
498+
"uretprobe:", go1_18_binary_path,
499499
":\"golang.org/x/net/http2.(*Framer).WriteDataPadded\",\n"
500500
"uretprobe:",
501-
go1_17_binary_path,
501+
go1_19_binary_path,
502502
":\"golang.org/x/net/http2.(*Framer).WriteDataPadded\""
503503
"{ printf(\"retval: %d\", retval); }"));
504504
}

src/stirling/source_connectors/dynamic_tracer/BUILD.bazel

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ pl_cc_bpf_test(
4848
timeout = "moderate",
4949
srcs = ["dynamic_trace_bpf_test.cc"],
5050
data = [
51-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_16_grpc_client",
5251
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_21_grpc_client",
53-
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_16_grpc_server_with_certs",
52+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_22_grpc_client",
53+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_23_grpc_client",
5454
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_21_grpc_server_with_certs",
55+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_22_grpc_server_with_certs",
56+
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_23_grpc_server_with_certs",
5557
],
5658
tags = [
5759
"cpu:16",
@@ -72,6 +74,8 @@ pl_cc_bpf_test(
7274
data = [
7375
"//src/stirling/obj_tools/testdata/cc:test_exe",
7476
"//src/stirling/obj_tools/testdata/go:test_go_1_21_binary",
77+
"//src/stirling/obj_tools/testdata/go:test_go_1_22_binary",
78+
"//src/stirling/obj_tools/testdata/go:test_go_1_23_binary",
7579
"//src/stirling/testing/dns:dns_hammer",
7680
"//src/stirling/testing/dns:dns_hammer_image.tar",
7781
],

0 commit comments

Comments
 (0)