From 1a476ec0b130e9ce0b08ab3d2dad36cd624fafae Mon Sep 17 00:00:00 2001 From: Jian Guan <61915096+tdq45gj@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:36:07 -0400 Subject: [PATCH 1/4] Update mongorestore_test.go --- mongorestore/mongorestore_test.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/mongorestore/mongorestore_test.go b/mongorestore/mongorestore_test.go index 362f69433..0443d3280 100644 --- a/mongorestore/mongorestore_test.go +++ b/mongorestore/mongorestore_test.go @@ -2052,23 +2052,6 @@ func TestRestoreTimeseriesCollectionsWithMixedSchema(t *testing.T) { t.Fatalf("No client available") } - fcv := testutil.GetFCV(session) - // TODO: Enable tests for 6.0, 7.0 and 8.0 (TOOLS-3597). - // The server fix for SERVER-84531 was only backported to 7.3. - if cmp, err := testutil.CompareFCV(fcv, "7.3"); cmp < 0 { - if err != nil { - t.Fatalf("Failed to get FCV: %v", err) - } - t.Skip("Requires server with FCV 7.3 or later") - } - - if cmp, err := testutil.CompareFCV(fcv, "8.0"); cmp >= 0 { - if err != nil { - t.Fatalf("Failed to get FCV: %v", err) - } - t.Skip("The test currently fails on v8.0 because of SERVER-92222") - } - dbName := "timeseries_test_DB" collName := "timeseries_mixed_schema" testdb := session.Database(dbName) From bb9d0a8a388b98e384f056ca7b0f8cc0212425fc Mon Sep 17 00:00:00 2001 From: Jian Guan <61915096+tdq45gj@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:47:37 -0400 Subject: [PATCH 2/4] Revert "Update mongorestore_test.go" This reverts commit 1a476ec0b130e9ce0b08ab3d2dad36cd624fafae. --- mongorestore/mongorestore_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mongorestore/mongorestore_test.go b/mongorestore/mongorestore_test.go index 0443d3280..362f69433 100644 --- a/mongorestore/mongorestore_test.go +++ b/mongorestore/mongorestore_test.go @@ -2052,6 +2052,23 @@ func TestRestoreTimeseriesCollectionsWithMixedSchema(t *testing.T) { t.Fatalf("No client available") } + fcv := testutil.GetFCV(session) + // TODO: Enable tests for 6.0, 7.0 and 8.0 (TOOLS-3597). + // The server fix for SERVER-84531 was only backported to 7.3. + if cmp, err := testutil.CompareFCV(fcv, "7.3"); cmp < 0 { + if err != nil { + t.Fatalf("Failed to get FCV: %v", err) + } + t.Skip("Requires server with FCV 7.3 or later") + } + + if cmp, err := testutil.CompareFCV(fcv, "8.0"); cmp >= 0 { + if err != nil { + t.Fatalf("Failed to get FCV: %v", err) + } + t.Skip("The test currently fails on v8.0 because of SERVER-92222") + } + dbName := "timeseries_test_DB" collName := "timeseries_mixed_schema" testdb := session.Database(dbName) From 2266228c5c11654b10d8636a5af468d4e5654c71 Mon Sep 17 00:00:00 2001 From: Jian Guan <61915096+tdq45gj@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:51:35 -0400 Subject: [PATCH 3/4] Update mongorestore_test.go --- mongorestore/mongorestore_test.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/mongorestore/mongorestore_test.go b/mongorestore/mongorestore_test.go index 362f69433..ccba145e9 100644 --- a/mongorestore/mongorestore_test.go +++ b/mongorestore/mongorestore_test.go @@ -2055,18 +2055,11 @@ func TestRestoreTimeseriesCollectionsWithMixedSchema(t *testing.T) { fcv := testutil.GetFCV(session) // TODO: Enable tests for 6.0, 7.0 and 8.0 (TOOLS-3597). // The server fix for SERVER-84531 was only backported to 7.3. - if cmp, err := testutil.CompareFCV(fcv, "7.3"); cmp < 0 { + if cmp, err := testutil.CompareFCV(fcv, "6.0"); cmp < 0 { if err != nil { t.Fatalf("Failed to get FCV: %v", err) } - t.Skip("Requires server with FCV 7.3 or later") - } - - if cmp, err := testutil.CompareFCV(fcv, "8.0"); cmp >= 0 { - if err != nil { - t.Fatalf("Failed to get FCV: %v", err) - } - t.Skip("The test currently fails on v8.0 because of SERVER-92222") + t.Skip("Requires server with FCV 6.0 or later") } dbName := "timeseries_test_DB" From 1e6cf6f2de8a59af4bcd4041f7e01d8d3ff3cb06 Mon Sep 17 00:00:00 2001 From: Jian Guan <61915096+tdq45gj@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:19:35 -0400 Subject: [PATCH 4/4] Update mongodump_test.go --- mongodump/mongodump_test.go | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/mongodump/mongodump_test.go b/mongodump/mongodump_test.go index fbc0f3e6d..bdcb5d1ff 100644 --- a/mongodump/mongodump_test.go +++ b/mongodump/mongodump_test.go @@ -378,27 +378,11 @@ func setupTimeseriesWithMixedSchema(dbName string, collName string) error { return createRes.Err() } - // SERVER-84531 was only backported to 7.3. - // TODO: Run collMod command on 6.0 and 7.0 (TOOLS-3597). - clientFCV := testutil.GetFCV(client) - - shouldAccommodateMixedSchema := clientFCV == "6.0" || clientFCV == "7.0" - if !shouldAccommodateMixedSchema { - cmp, err := testutil.CompareFCV(clientFCV, "7.3") - if err != nil { - return errors.Wrapf(err, "failed to compare client FCV (%s)", clientFCV) - } - - shouldAccommodateMixedSchema = cmp >= 0 - } - - if shouldAccommodateMixedSchema { - if res := sessionProvider.DB(dbName).RunCommand(context.Background(), bson.D{ - {"collMod", collName}, - {"timeseriesBucketsMayHaveMixedSchemaData", true}, - }); res.Err() != nil { - return res.Err() - } + if res := sessionProvider.DB(dbName).RunCommand(context.Background(), bson.D{ + {"collMod", collName}, + {"timeseriesBucketsMayHaveMixedSchemaData", true}, + }); res.Err() != nil { + return res.Err() } bucketColl := sessionProvider.DB(dbName).Collection("system.buckets." + collName)