diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 632b264d0..eeb98a410 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -1399,6 +1399,7 @@ jobs: --suite //cmd/bd:bd_embedded_part2_test .github/scripts/embedded-test-shard.sh 50@50/100 --suite //internal/storage/embeddeddolt:embeddeddolt_embedded_test .github/scripts/embedded-storage-test-shard.sh 40 --whole //internal/storage/embeddeddolt:embeddeddolt_conformance_core_test + --whole //internal/storage/embeddeddolt:embeddeddolt_conformance_core_slow_test --whole //internal/storage/embeddeddolt:embeddeddolt_conformance_audit_test - name: Upload test logs diff --git a/internal/storage/embeddeddolt/BUILD.bazel b/internal/storage/embeddeddolt/BUILD.bazel index 7997a0f13..474d6cc45 100644 --- a/internal/storage/embeddeddolt/BUILD.bazel +++ b/internal/storage/embeddeddolt/BUILD.bazel @@ -315,7 +315,13 @@ sh_test( ) # PR Risk's "Test (Embedded Dolt Conformance - core)" job: conformance.RunAll -# except its Audit group, with the job's binary flags but -test.timeout. +# except its Audit group, with the job's binary flags but -test.timeout. It +# runs as two targets: this one skips Audit and the groups +# embeddeddolt_conformance_core_slow_test (below) runs, so the two run every +# core group exactly once between them (a group added to RunAll lands here). +# As one action it took 108-150s on rbe-west, ~half of it those two groups. +# Every RunAll group builds its own store from the factory, so the split +# shares no state. # # Tags: # embedded: the embedded-Dolt tier; excluded from --config=prcore/ci, @@ -335,7 +341,32 @@ sh_test( "-test.count=1", "-test.timeout=19m", "-test.run=^TestConformance$$", - "-test.skip=^TestConformance$$/^Audit$$", + "-test.skip=^TestConformance$$/^(Audit|ReadyCountsPageChunking|Portable)$$", + ], + data = [":embeddeddolt_test"], + env = {"BEADS_TEST_EMBEDDED_DOLT": "1"}, + tags = ["embedded"], +) + +# The slow groups of the core conformance partition (see +# embeddeddolt_conformance_core_test, which skips exactly these): +# ReadyCountsPageChunking (~33s) and Portable (~20s) under -race. +# +# Tags: +# embedded: the embedded-Dolt tier; excluded from --config=prcore/ci, +# selected by --config=embedded. +sh_test( + name = "embeddeddolt_conformance_core_slow_test", + size = "large", + # -test.timeout=19m: as embeddeddolt_conformance_core_test. + timeout = "eternal", + srcs = ["//tools/bazel:go_test_variant.sh"], + args = [ + "$(rootpath :embeddeddolt_test)", + "-test.v", + "-test.count=1", + "-test.timeout=19m", + "-test.run=^TestConformance$$/^(ReadyCountsPageChunking|Portable)$$", ], data = [":embeddeddolt_test"], env = {"BEADS_TEST_EMBEDDED_DOLT": "1"}, diff --git a/scripts/ci_workflow_test.go b/scripts/ci_workflow_test.go index cabb5ed54..5775326b9 100644 --- a/scripts/ci_workflow_test.go +++ b/scripts/ci_workflow_test.go @@ -4393,12 +4393,32 @@ func TestBazelEmbeddedJobRunsEmbeddedTier(t *testing.T) { } // The retired test-embedded-conformance job's two partitions, frozen. + // Core runs as two targets: embeddeddolt_conformance_core_test runs the + // job's core selector but also skips conformanceCoreSlowGroups, which + // embeddeddolt_conformance_core_slow_test runs instead, so between them + // they run every core group exactly once. conformance := map[string]string{ "core": `/tmp/embeddeddolt-test -test.v -test.count=1 -test.timeout=30m -test.run '^TestConformance$' -test.skip '^TestConformance$/^Audit$'`, "audit": `/tmp/embeddeddolt-test -test.v -test.count=1 -test.timeout=30m -test.run '^TestConformance$/^Audit$'`, } + slow := strings.Join(conformanceCoreSlowGroups, "|") + // What each target's rule must say instead of the job's own selector. + retarget := map[string]map[string]string{ + "embeddeddolt_conformance_core_test": { + `"-test.skip=^TestConformance$$/^Audit$$",`: `"-test.skip=^TestConformance$$/^(Audit|` + slow + `)$$",`, + }, + "embeddeddolt_conformance_core_slow_test": { + `"-test.run=^TestConformance$$",`: `"-test.run=^TestConformance$$/^(` + slow + `)$$",`, + `"-test.skip=^TestConformance$$/^Audit$$",`: "", + }, + } quoted := regexp.MustCompile(`(-test\.[a-z]+) '([^']*)'|(-test\.[a-z]+=\S+|-test\.v)`) - for partition, target := range map[string]string{"core": "embeddeddolt_conformance_core_test", "audit": "embeddeddolt_conformance_audit_test"} { + for _, c := range []struct{ partition, target string }{ + {"core", "embeddeddolt_conformance_core_test"}, + {"core", "embeddeddolt_conformance_core_slow_test"}, + {"audit", "embeddeddolt_conformance_audit_test"}, + } { + partition, target := c.partition, c.target run := conformance[partition] fields := strings.Fields(run) if len(fields) == 0 || fields[0] != "/tmp/embeddeddolt-test" { @@ -4406,15 +4426,22 @@ func TestBazelEmbeddedJobRunsEmbeddedTier(t *testing.T) { } var want []string for _, m := range quoted.FindAllStringSubmatch(run, -1) { + var w string switch { case m[1] != "": - want = append(want, `"`+m[1]+"="+strings.ReplaceAll(m[2], "$", "$$")+`",`) + w = `"` + m[1] + "=" + strings.ReplaceAll(m[2], "$", "$$") + `",` case strings.HasPrefix(m[3], "-test.timeout="): // Documented deviation: Bazel kills at 1200s without a // goroutine dump, so the variant's Go timeout is 19m. - want = append(want, `"-test.timeout=19m",`) + w = `"-test.timeout=19m",` default: - want = append(want, `"`+m[3]+`",`) + w = `"` + m[3] + `",` + } + if r, ok := retarget[target][w]; ok { + w = r + } + if w != "" { + want = append(want, w) } } if len(want) < 4 { @@ -4429,6 +4456,14 @@ func TestBazelEmbeddedJobRunsEmbeddedTier(t *testing.T) { } } +// conformanceCoreSlowGroups are the conformance.RunAll groups +// embeddeddolt_conformance_core_slow_test runs and +// embeddeddolt_conformance_core_test skips. The core target skips only these +// names, so a group renamed or added in RunAll still runs there: a name here +// that RunAll no longer has matches nothing in either target and loses no +// group, only the split (core gets slower again). +var conformanceCoreSlowGroups = []string{"ReadyCountsPageChunking", "Portable"} + // bazel-pure replaces pr.yml's check-cmd-bd-puregeo-tests job: the same pure // cmd/bd test selector, the same pure build set, and the js/wasm hook test // under the same exact-count guard. diff --git a/scripts/pr_risk_bazel_coverage_test.go b/scripts/pr_risk_bazel_coverage_test.go index 0a57f6785..c2e206425 100644 --- a/scripts/pr_risk_bazel_coverage_test.go +++ b/scripts/pr_risk_bazel_coverage_test.go @@ -344,7 +344,7 @@ func TestBazelRetiredLanesCheckListedTestsRan(t *testing.T) { // The cmd/bd block is split over embeddedCmdTargets: one // --suite each, SHARDS@OFFSET/TOTAL (added below). {"test-embedded-storage", "Test", "//internal/storage/embeddeddolt:embeddeddolt_embedded_test", ".github/scripts/embedded-storage-test-shard.sh", -1}, - }, []string{"//internal/storage/embeddeddolt:embeddeddolt_conformance_core_test", "//internal/storage/embeddeddolt:embeddeddolt_conformance_audit_test"}}, + }, []string{"//internal/storage/embeddeddolt:embeddeddolt_conformance_core_test", "//internal/storage/embeddeddolt:embeddeddolt_conformance_core_slow_test", "//internal/storage/embeddeddolt:embeddeddolt_conformance_audit_test"}}, {bazelProxiedJobName, "doltserver-proxied", []suite{ // bazel-proxied runs its own duration-balanced manifest block // (scripts/ci/proxied_test_durations.json), not PR Risk's frozen @@ -874,7 +874,11 @@ func TestBazelRetiredLanesCannotBeNarrowed(t *testing.T) { map[string]string{"BEADS_TEST_EMBEDDED_DOLT": "1"}, }, "//internal/storage/embeddeddolt:embeddeddolt_conformance_core_test": { - []string{"$(rootpath :embeddeddolt_test)", "-test.v", "-test.count=1", "-test.timeout=19m", "-test.run=^TestConformance$$", "-test.skip=^TestConformance$$/^Audit$$"}, + []string{"$(rootpath :embeddeddolt_test)", "-test.v", "-test.count=1", "-test.timeout=19m", "-test.run=^TestConformance$$", "-test.skip=^TestConformance$$/^(Audit|ReadyCountsPageChunking|Portable)$$"}, + map[string]string{"BEADS_TEST_EMBEDDED_DOLT": "1"}, + }, + "//internal/storage/embeddeddolt:embeddeddolt_conformance_core_slow_test": { + []string{"$(rootpath :embeddeddolt_test)", "-test.v", "-test.count=1", "-test.timeout=19m", "-test.run=^TestConformance$$/^(ReadyCountsPageChunking|Portable)$$"}, map[string]string{"BEADS_TEST_EMBEDDED_DOLT": "1"}, }, "//internal/storage/embeddeddolt:embeddeddolt_conformance_audit_test": {