Skip to content

Commit f130aab

Browse files
committed
Merge branch 'main' into REP-5329-retry-more-consistently
2 parents cca23ab + 4f3d3aa commit f130aab

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

internal/verifier/check.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ func (verifier *Verifier) CheckWorker(ctxIn context.Context) error {
139139
err := eg.Wait()
140140

141141
if succeeded {
142+
if !errors.Is(err, context.Canceled) {
143+
panic("success should mean that err is context.Canceled, not: " + err.Error())
144+
}
145+
142146
err = nil
143147
}
144148

internal/verifier/migration_verifier.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -904,12 +904,10 @@ func (verifier *Verifier) doIndexSpecsMatch(ctx context.Context, srcSpec bson.Ra
904904
ctx,
905905
mongo.Pipeline{
906906
{{"$documents", []bson.D{
907-
{{"spec", srcSpec}},
908-
}}},
909-
910-
// Add the destination spec.
911-
{{"$addFields", bson.D{
912-
{"dstSpec", dstSpec},
907+
{
908+
{"spec", bson.D{{"$literal", srcSpec}}},
909+
{"dstSpec", bson.D{{"$literal", dstSpec}}},
910+
},
913911
}}},
914912

915913
{{"$unset", lo.Reduce(

internal/verifier/migration_verifier_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,19 @@ func (suite *IntegrationTestSuite) TestVerifierCompareIndexSpecs() {
10831083
shouldMatch: true,
10841084
},
10851085

1086+
{
1087+
label: "ignore number types, deep",
1088+
src: bson.D{
1089+
{"name", "testIndex"},
1090+
{"key", bson.M{"foo.bar": float64(123)}},
1091+
},
1092+
dst: bson.D{
1093+
{"name", "testIndex"},
1094+
{"key", bson.M{"foo.bar": 123}},
1095+
},
1096+
shouldMatch: true,
1097+
},
1098+
10861099
{
10871100
label: "find number differences",
10881101
src: bson.D{

0 commit comments

Comments
 (0)