-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GODRIVER-3519 Test sharded clusters with requireApiVersion=1 #1997
Conversation
API Change ReportNo changes found! |
I am seeing some failures as a result of the api version not being set in some of the encryption prose tests, but I couldn't figure out how to handle them.
[2025/03/25 15:24:52.475] === NAME TestClientSideEncryptionProse/12._explicit_encryption
[2025/03/25 15:24:52.475] client_side_encryption_prose_test.go:1698:
[2025/03/25 15:24:52.475] Error Trace: /data/mci/fe01f8c411c05606a12337b8cc3c283f/src/go.mongodb.org/mongo-driver/internal/integration/client_side_encryption_prose_test.go:1698
[2025/03/25 15:24:52.475] /data/mci/fe01f8c411c05606a12337b8cc3c283f/src/go.mongodb.org/mongo-driver/internal/integration/client_side_encryption_prose_test.go:1719
[2025/03/25 15:24:52.475] /data/mci/fe01f8c411c05606a12337b8cc3c283f/src/go.mongodb.org/mongo-driver/internal/integration/mongotest.go:232
[2025/03/25 15:24:52.475] Error: Expected nil, but got: topology.ServerSelectionError{Desc:description.Topology{Servers:[]description.Server{description.Server{Addr:"localhost:27018", Arbiters:[]string(nil), AverageRTT:0, AverageRTTSet:false, Compression:[]string(nil), CanonicalAddr:"", ElectionID:bson.ObjectID{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, HeartbeatInterval:0, HelloOK:false, Hosts:[]string(nil), IsCryptd:false, LastError:driver.Error{Code:498870, Message:"The apiVersion parameter is required, please configure your MongoClient's API version", Labels:[]string(nil), Name:"Location498870", Wrapped:error(nil), TopologyVersion:(*description.TopologyVersion)(nil), Raw:bsoncore.Document{0x17, 0x1, 0x0, 0x0, 0x1, 0x6f, 0x6b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x0, 0x56, 0x0, 0x0, 0x0, 0x54, 0x68, 0x65, 0x20, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x27, 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x0, 0x10, 0x63, 0x6f, 0x64, 0x65, 0x0, 0xb6, 0x9c, 0x7, 0x0, 0x2, 0x63, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x0, 0xf, 0x0, 0x0, 0x0, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x34, 0x39, 0x38, 0x38, 0x37, 0x30, 0x0, 0x3, 0x24, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x58, 0x0, 0x0, 0x0, 0x11, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x2, 0x0, 0x0, 0x0, 0x43, 0x10, 0xe3, 0x67, 0x3, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x0, 0x33, 0x0, 0x0, 0x0, 0x5, 0x68, 0x61, 0x73, 0x68, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x8d, 0x60, 0x6b, 0x6d, 0xde, 0x68, 0xce, 0x7a, 0x3f, 0x6f, 0x24, 0xb8, 0xcf, 0x37, 0x38, 0x86, 0xb1, 0xc4, 0xd2, 0x97, 0x12, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x0, 0x1a, 0x0, 0x0, 0x0, 0x6e, 0xd, 0xe3, 0x67, 0x0, 0x0, 0x11, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x2, 0x0, 0x0, 0x0, 0x43, 0x10, 0xe3, 0x67, 0x0}}, LastUpdateTime:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), LastWriteTime:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), MaxBatchCount:0x0, MaxDocumentSize:0x0, MaxMessageSize:0x0, Members:[]address.Address(nil), Passives:[]string(nil), Passive:false, Primary:"", ReadOnly:false, ServiceID:(*bson.ObjectID)(nil), SessionTimeoutMinutes:(*int64)(nil), SetName:"", SetVersion:0x0, Tags:tag.Set(nil), TopologyVersion:(*description.TopologyVersion)(nil), Kind:0x0, WireVersion:(*description.VersionRange)(nil)}, description.Server{Addr:"localhost:27017", Arbiters:[]string(nil), AverageRTT:0, AverageRTTSet:false, Compression:[]string(nil), CanonicalAddr:"", ElectionID:bson.ObjectID{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, HeartbeatInterval:0, HelloOK:false, Hosts:[]string(nil), IsCryptd:false, LastError:driver.Error{Code:498870, Message:"The apiVersion parameter is required, please configure your MongoClient's API version", Labels:[]string(nil), Name:"Location498870", Wrapped:error(nil), TopologyVersion:(*description.TopologyVersion)(nil), Raw:bsoncore.Document{0x17, 0x1, 0x0, 0x0, 0x1, 0x6f, 0x6b, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x65, 0x72, 0x72, 0x6d, 0x73, 0x67, 0x0, 0x56, 0x0, 0x0, 0x0, 0x54, 0x68, 0x65, 0x20, 0x61, 0x70, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2c, 0x20, 0x70, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72, 0x20, 0x4d, 0x6f, 0x6e, 0x67, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x27, 0x73, 0x20, 0x41, 0x50, 0x49, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x0, 0x10, 0x63, 0x6f, 0x64, 0x65, 0x0, 0xb6, 0x9c, 0x7, 0x0, 0x2, 0x63, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x0, 0xf, 0x0, 0x0, 0x0, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x34, 0x39, 0x38, 0x38, 0x37, 0x30, 0x0, 0x3, 0x24, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x58, 0x0, 0x0, 0x0, 0x11, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x3, 0x0, 0x0, 0x0, 0x43, 0x10, 0xe3, 0x67, 0x3, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x0, 0x33, 0x0, 0x0, 0x0, 0x5, 0x68, 0x61, 0x73, 0x68, 0x0, 0x14, 0x0, 0x0, 0x0, 0x0, 0x8d, 0x60, 0x6b, 0x6d, 0xde, 0x68, 0xce, 0x7a, 0x3f, 0x6f, 0x24, 0xb8, 0xcf, 0x37, 0x38, 0x86, 0xb1, 0xc4, 0xd2, 0x97, 0x12, 0x6b, 0x65, 0x79, 0x49, 0x64, 0x0, 0x1a, 0x0, 0x0, 0x0, 0x6e, 0xd, 0xe3, 0x67, 0x0, 0x0, 0x11, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x0, 0x3, 0x0, 0x0, 0x0, 0x43, 0x10, 0xe3, 0x67, 0x0}}, LastUpdateTime:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), LastWriteTime:time.Date(1, time.January, 1, 0, 0, 0, 0, time.UTC), MaxBatchCount:0x0, MaxDocumentSize:0x0, MaxMessageSize:0x0, Members:[]address.Address(nil), Passives:[]string(nil), Passive:false, Primary:"", ReadOnly:false, ServiceID:(*bson.ObjectID)(nil), SessionTimeoutMinutes:(*int64)(nil), SetName:"", SetVersion:0x0, Tags:tag.Set(nil), TopologyVersion:(*description.TopologyVersion)(nil), Kind:0x0, WireVersion:(*description.VersionRange)(nil)}}, SetName:"", Kind:0x0, SessionTimeoutMinutes:(*int64)(nil), CompatibilityErr:error(nil)}, Wrapped:context.deadlineExceededError{}}
[2025/03/25 15:24:52.475] Test: TestClientSideEncryptionProse/12._explicit_encryption
[2025/03/25 15:24:52.475] Messages: error on InsertOne: server selection error: context deadline exceeded, current topology: { Type: Unknown, Servers: [{ Addr: localhost:27018, Type: Unknown, Last error: (Location498870) The apiVersion parameter is required, please configure your MongoClient's API version }, { Addr: localhost:27017, Type: Unknown, Last error: (Location498870) The apiVersion parameter is required, please configure your MongoClient's API version }, ] }
|
@blink1073 I believe you need to use For example, this line should be replaced with opts := options.Client().ApplyURI(mtest.ClusterURI())
integtest.AddTestServerAPIVersion(opts)
keyVaultClient, err := mongo.Connect(opts) I haven't tested that, but other uses of |
Cheers, I'll give that a shot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔧
GODRIVER-3519
Summary
Add tests for sharded clusters with requireApiVersion=1
Background & Motivation
Previously we were only testing with standalone servers. We are now unblocked from testing on sharded clusters, but not yet on replica sets.