From 34ef185ba5af4648e541e5b492bee9da27bd14bd Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 3 Nov 2026 19:33:43 +0100 Subject: [PATCH] The assigner's integration test puts the provider's module before the consumer's, so the consumer's requirement always has a provider to be judged against (the group check's flaky failure, 5 of 40 runs) --- .../cmd/mesh-delivery-assigner/integration_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/integration_test.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/integration_test.go index cadba393..7b456f16 100644 --- a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/integration_test.go +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/integration_test.go @@ -448,9 +448,12 @@ func TestWantsAreWrittenAndNoDifferenceIs(t *testing.T) { toolDigest := b.manifest(t, "tool", `{"module":"tool","version":"1"}`) fpOf := func(c byte) string { return delivery.SourcePrefix2 + strings.Repeat(string(c), 64) } toolOld := fpOf('1') - for module, row := range map[string]struct { - fp, digest string - }{"db": {fpOf('2'), dbDigest}, "app": {fpOf('3'), appDigest}, "tool": {fpOf('4'), toolDigest}} { + // In this order: the provider's module is in the indexer's state before the consumer's, so the consumer's requirement + // has a provider to be judged against whenever the assigner looks at it (a map's order made it flaky, 5 of 40 runs). + for _, row := range []struct { + module, fp, digest string + }{{"db", fpOf('2'), dbDigest}, {"app", fpOf('3'), appDigest}, {"tool", fpOf('4'), toolDigest}} { + module := row.module mod, _ := delivery.EncodeModule(delivery.Module{FP2: row.fp, Manifest: row.digest, Repository: "novox/" + module, Commit: strings.Repeat("2", 40), Path: delivery.RootPath}) b.putJSON(t, delivery.ModulesBucket, module, mod) fps := []string{row.fp}