Skip to content

Commit

Permalink
dev: pad internal timeouts when under --stress --timeout
Browse files Browse the repository at this point in the history
I was seeing the earlier one second buffer being insufficient.

Release note: None
  • Loading branch information
irfansharif committed Oct 28, 2021
1 parent 2c82a27 commit c485cc5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit c485cc5

Please sign in to comment.