Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
92095: ci: add script to build and push bazel builder image r=[rickystewart,rail] a=healthy-pod

Release note: None
Part of: CRDB-11061

92334: sqlstats: deflake TestSQLStatsIdleLatencies r=matthewtodd a=matthewtodd

Fixes #91710

Release note: None

92343: testccl/workload/schemachange: shorten test r=ajwerner a=ajwerner

When it runs with 800, it gets more likely that it's going to run into backoffs and it takes non-linearly longer.

Fixes #92187

Release note: None

Co-authored-by: healthy-pod <[email protected]>
Co-authored-by: Matthew Todd <[email protected]>
Co-authored-by: Andrew Werner <[email protected]>
  • Loading branch information
4 people committed Nov 22, 2022
4 parents 59de8e8 + bf739d0 + 3811a0a + 5ebdcf1 commit e6b30e1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -xeuo pipefail

TAG=$(date +%Y%m%d-%H%M%S)
docker buildx create --name "builder-$TAG" --use
docker buildx build --push --platform linux/amd64,linux/arm64 -t "cockroachdb/bazel:$TAG" -t "cockroachdb/bazel:latest-do-not-use" build/bazelbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestWorkload(t *testing.T) {
ql, err := wl.Ops(ctx, []string{pgURL.String()}, reg)
require.NoError(t, err)

const N = 800
const N = 100
workerFn := func(ctx context.Context, fn func(ctx context.Context) error) func() error {
return func() error {
for i := 0; i < N; i++ {
Expand Down
1 change: 1 addition & 0 deletions pkg/sql/sqlstats/sslocal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ go_test(
"//pkg/testutils/sqlutils",
"//pkg/testutils/testcluster",
"//pkg/util",
"//pkg/util/buildutil",
"//pkg/util/leaktest",
"//pkg/util/log",
"//pkg/util/mon",
Expand Down
18 changes: 14 additions & 4 deletions pkg/sql/sqlstats/sslocal/sql_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
"github.com/cockroachdb/cockroach/pkg/testutils/sqlutils"
"github.com/cockroachdb/cockroach/pkg/util"
"github.com/cockroachdb/cockroach/pkg/util/buildutil"
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/mon"
Expand Down Expand Up @@ -1109,9 +1110,7 @@ func TestSQLStatsIdleLatencies(t *testing.T) {
defer leaktest.AfterTest(t)()
defer log.Scope(t).Close(t)

skip.WithIssue(t, 91710)

skip.UnderStress(t, "These tests assert timings are within 10ms, which fails under stress.")
skip.UnderStress(t, "These tests make timing assertions, which may fail under stress.")

ctx := context.Background()
params, _ := tests.CreateTestServerParams()
Expand Down Expand Up @@ -1287,7 +1286,18 @@ func TestSQLStatsIdleLatencies(t *testing.T) {
actual[query] = latency
}
require.NoError(t, rows.Err())
require.InDeltaMapValues(t, tc.lats, actual, 0.01,

// Make looser timing assertions in CI, since we've seen
// more variability there.
// - Bazel test runs also use this looser delta.
// - Goland and `go test` use the tighter delta unless
// the crdb_test build tag has been set.
delta := 0.002
if buildutil.CrdbTestBuild {
delta = 0.05
}

require.InDeltaMapValues(t, tc.lats, actual, delta,
"expected: %v\nactual: %v", tc.lats, actual)
})
}
Expand Down

0 comments on commit e6b30e1

Please sign in to comment.