Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
72099: bazel: glob-exclude all *_generated.go files from Gazelle r=rail a=rickystewart

This review is only for the second commit in the stack; the other is from #72098.

This will help ensure that Gazelle doesn't accidentally reference
checked-in generated code.

The generated code in `pkg/col/colserde/arrowserde` is made by `flatc`,
the FlatBuffers compiler -- I tried to make a `genrule` to generate this
code but the code that `flatc` generates now doesn't match up to what's
checked in (maybe we used a different version of `flatc` for the
original version of the code?)

Closes #72096.

Release note: None

72125: dev: pad internal timeouts when under --stress --timeout r=irfansharif a=irfansharif

I was seeing the earlier one second buffer being insufficient.

Release note: None

72264: Move metric scope library r=miretskiy a=miretskiy

This is move only PR which moves metrics scope library from
cdcutils directly under changefeedccl.

It is structured as add/remove PR so that the "add" portion can be easily backported.

Release Notes: None

Co-authored-by: Ricky Stewart <[email protected]>
Co-authored-by: irfan sharif <[email protected]>
Co-authored-by: Yevgeniy Miretskiy <[email protected]>
  • Loading branch information
4 people committed Nov 1, 2021
4 parents 1f705cc + df75249 + c485cc5 + 9a187e0 commit 83ace64
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 39 deletions.
19 changes: 1 addition & 18 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ load("@bazel_gazelle//:def.bzl", "gazelle")
# gazelle:resolve proto go roachpb/io-formats.proto //pkg/roachpb:with-mocks
# gazelle:resolve proto go roachpb/metadata.proto //pkg/roachpb:with-mocks
# gazelle:resolve proto go roachpb/span_config.proto //pkg/roachpb:with-mocks
# gazelle:exclude pkg/roachpb/batch_generated.go
# gazelle:exclude pkg/roachpb/batch_generated-gen.go

# See pkg/sql/opt/optgen/cmd/langgen/BUILD.bazel for more details.
Expand Down Expand Up @@ -107,7 +106,7 @@ load("@bazel_gazelle//:def.bzl", "gazelle")
# gazelle:exclude **/*.pb.gw.go
# gazelle:exclude **/*_interval_btree.go
# gazelle:exclude **/*_interval_btree_test.go
# gazelle:exclude **/mocks_generated.go
# gazelle:exclude **/*_generated.go
# gazelle:exclude pkg/sql/parser/sql.go
# gazelle:exclude pkg/sql/parser/helpmap_test.go
# gazelle:exclude pkg/sql/parser/help_messages.go
Expand All @@ -118,25 +117,9 @@ load("@bazel_gazelle//:def.bzl", "gazelle")
# gazelle:exclude pkg/testutils/**/testdata/**
# gazelle:exclude pkg/security/securitytest/embedded.go
# gazelle:exclude pkg/cmd/roachprod/vm/aws/embedded.go
# gazelle:exclude pkg/cmd/roachtest/prometheus/mock_generated.go
# gazelle:exclude pkg/cmd/roachtest/tests/drt_generated.go
# gazelle:exclude pkg/**/*_string.go
# gazelle:exclude pkg/geo/wkt/wkt_generated.go
# gazelle:exclude pkg/sql/schemachanger/scop/backfill_visitor_generated.go
# gazelle:exclude pkg/sql/schemachanger/scop/mutation_visitor_generated.go
# gazelle:exclude pkg/sql/schemachanger/scop/validation_visitor_generated.go
# gazelle:exclude pkg/sql/schemachanger/scpb/elements_generated.go
# gazelle:exclude pkg/ui/distccl/distccl_no_bazel.go
# gazelle:exclude pkg/ui/distoss/distoss_no_bazel.go
# gazelle:exclude pkg/util/log/channel/channel_generated.go
# gazelle:exclude pkg/util/log/eventpb/eventlog_channels_generated.go
# gazelle:exclude pkg/util/log/eventpb/json_encode_generated.go
# gazelle:exclude pkg/util/log/log_channels_generated.go
# gazelle:exclude pkg/util/log/severity/severity_generated.go
# gazelle:exclude pkg/util/timeutil/lowercase_timezones_generated.go
#
# TODO(irfansharif): Hand excluding these _generated.go/_stringer.go files is
# silly, we should glob exclude everything once we have full coverage.
#
# Generally useful references:
#
Expand Down
3 changes: 3 additions & 0 deletions pkg/ccl/changefeedccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ go_library(
"doc.go",
"encoder.go",
"metrics.go",
"metrics_scope.go",
"name.go",
"rowfetcher_cache.go",
"schema_registry.go",
Expand Down Expand Up @@ -122,6 +123,7 @@ go_test(
"helpers_tenant_shim_test.go",
"helpers_test.go",
"main_test.go",
"metrics_scope_test.go",
"name_test.go",
"nemeses_test.go",
"schema_registry_test.go",
Expand Down Expand Up @@ -200,6 +202,7 @@ go_test(
"//pkg/util/json",
"//pkg/util/leaktest",
"//pkg/util/log",
"//pkg/util/metric",
"//pkg/util/mon",
"//pkg/util/protoutil",
"//pkg/util/randutil",
Expand Down
11 changes: 2 additions & 9 deletions pkg/ccl/changefeedccl/cdcutils/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
name = "cdcutils",
srcs = [
"metrics_scope.go",
"throttle.go",
],
srcs = ["throttle.go"],
importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/cdcutils",
visibility = ["//visibility:public"],
deps = [
Expand All @@ -21,17 +18,13 @@ go_library(

go_test(
name = "cdcutils_test",
srcs = [
"metrics_scope_test.go",
"throttle_test.go",
],
srcs = ["throttle_test.go"],
embed = [":cdcutils"],
deps = [
"//pkg/ccl/changefeedccl/changefeedbase",
"//pkg/settings/cluster",
"//pkg/util/leaktest",
"//pkg/util/log",
"//pkg/util/metric",
"@com_github_stretchr_testify//require",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt

package cdcutils
package changefeedccl

import (
"fmt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt

package cdcutils
package changefeedccl

import (
"fmt"
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/dev/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ func (d *dev) test(cmd *cobra.Command, commandLine []string) error {
args = append(args, "--run_under",
fmt.Sprintf("%s -maxtime=%s %s", stressTarget, timeout, stressArgs))

// The bazel timeout needs to be higher than the stress duration to
// pass reliably.
args = append(args, fmt.Sprintf("--test_timeout=%.0f", (timeout+time.Second).Seconds()))
// The timeout should be higher than the stress duration, lets
// generously give it an extra minute.
args = append(args, fmt.Sprintf("--test_timeout=%d", int((timeout+time.Minute).Seconds())))
} else {
// We're running under stress and no timeout is specified. We want
// to respect the timeout passed down to stress[1]. Similar to above
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/dev/testdata/recording/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ bazel query 'kind(go_test, //pkg/util/tracing:all)'
----
//pkg/util/tracing:tracing_test

bazel test --test_sharding_strategy=disabled //pkg/util/tracing:tracing_test --run_under '@com_github_cockroachdb_stress//:stress -maxtime=10s ' --test_timeout=11 '--test_filter=TestStartChild*' --test_output streamed
bazel test --test_sharding_strategy=disabled //pkg/util/tracing:tracing_test --run_under '@com_github_cockroachdb_stress//:stress -maxtime=10s ' --test_timeout=70 '--test_filter=TestStartChild*' --test_output streamed
----
----
==================== Test output for //pkg/util/tracing:tracing_test:
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/dev/testdata/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bazel test --test_sharding_strategy=disabled //pkg/util/tracing:tracing_test --r
dev test --stress pkg/util/tracing --filter TestStartChild* --timeout=10s -v
----
bazel query 'kind(go_test, //pkg/util/tracing:all)'
bazel test --test_sharding_strategy=disabled //pkg/util/tracing:tracing_test --run_under '@com_github_cockroachdb_stress//:stress -maxtime=10s ' --test_timeout=11 '--test_filter=TestStartChild*' --test_output streamed
bazel test --test_sharding_strategy=disabled //pkg/util/tracing:tracing_test --run_under '@com_github_cockroachdb_stress//:stress -maxtime=10s ' --test_timeout=70 '--test_filter=TestStartChild*' --test_output streamed

dev test //pkg/testutils --timeout=10s
----
Expand Down
12 changes: 7 additions & 5 deletions pkg/col/colserde/arrowserde/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ go_library(
name = "arrowserde",
srcs = [
"doc.go",
"file_generated.go",
"message_generated.go",
"schema_generated.go",
"tensor_generated.go",
"file_generated.go", # keep
"message_generated.go", # keep
"schema_generated.go", # keep
"tensor_generated.go", # keep
],
importpath = "github.com/cockroachdb/cockroach/pkg/col/colserde/arrowserde",
visibility = ["//visibility:public"],
deps = ["@com_github_google_flatbuffers//go"],
deps = [
"@com_github_google_flatbuffers//go", # keep
],
)

0 comments on commit 83ace64

Please sign in to comment.