Skip to content

Commit 6c32704

Browse files
committed
internal/core/adt: revert the top-level parallelism of EvalV{1,2} tests
Otherwise using CUE_UPDATE=1 would cause races when updating the outputs in txtar files, as TestEvalV3 relies on the results of TestEvalV2. `go test` slows down a bit due to this, from ~2s to ~2.2s on my machine, but it's not too bad given that all the sub-tests still run in parallel amongst themselves within each top-level test. Signed-off-by: Daniel Martí <[email protected]> Change-Id: Ie530257985d15eeadb2f684136ce6e6610bb7aaf Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1219274 TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent 4f388b1 commit 6c32704

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/core/adt/eval_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ var (
4444
)
4545

4646
// TestEvalV2 tests the old implementation of the evaluator.
47+
// Note that [TestEvalV3] with CUE_UPDATE=1 assumes it runs after this test
48+
// for the sake of comparing results between the two evaluator versions.
49+
// As such, these two tests are not parallel at the top level.
50+
//
51+
// Note that this also means that CUE_UPDATE=1 is broken under `go test -shuffle`.
4752
func TestEvalV2(t *testing.T) {
48-
t.Parallel()
4953
test := cuetxtar.TxTarTest{
5054
Root: "../../../cue/testdata",
5155
Name: "eval",
@@ -67,7 +71,6 @@ func TestEvalV2(t *testing.T) {
6771
}
6872

6973
func TestEvalV3(t *testing.T) {
70-
t.Parallel()
7174
adt.DebugDeps = true // check unmatched dependencies.
7275

7376
test := cuetxtar.TxTarTest{

0 commit comments

Comments
 (0)