Skip to content

Commit fc7ebbb

Browse files
Revert "Release/1.11 (#1146)"
This reverts commit bf833d5.
1 parent bf833d5 commit fc7ebbb

File tree

65 files changed

+61
-583
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+61
-583
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,6 @@ tasks:
10451045
- name: sa-fmt
10461046
tags: ["static-analysis"]
10471047
commands:
1048-
- func: install-linters
10491048
- func: run-make
10501049
vars:
10511050
targets: check-fmt

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ build-tests:
4747

4848
.PHONY: check-fmt
4949
check-fmt:
50-
etc/check_fmt.sh
50+
etc/check_fmt.sh $(PKGS)
5151

5252
# check-modules runs "go mod tidy" then "go mod vendor" and exits with a non-zero exit code if there
5353
# are any module or vendored modules changes. The intent is to confirm two properties:
@@ -69,7 +69,7 @@ doc:
6969

7070
.PHONY: fmt
7171
fmt:
72-
go fmt ./...
72+
gofmt -l -s -w $(PKGS)
7373

7474
.PHONY: lint
7575
lint:

etc/check_fmt.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
2-
# check_fmt
3-
# Runs go fmt on all packages in the repo and checks that *_example_test.go files have wrapped lines.
2+
# check_fmt gopackages...
3+
# Runs gofmt on given packages and checks that *_example_test.go files have wrapped lines.
44

5-
gofmt_out="$(go fmt ./...)"
5+
gofmt_out="$(gofmt -l -s "$@")"
66

77
if [[ $gofmt_out ]]; then
8-
echo "go fmt check failed for:";
8+
echo "gofmt check failed for:";
99
sed -e 's/^/ - /' <<< "$gofmt_out";
1010
exit 1;
1111
fi
@@ -16,7 +16,7 @@ fi
1616
# E.g ignored lines:
1717
# // "mongodb://ldap-user:ldap-pwd@localhost:27017/?authMechanism=PLAIN"
1818
# // (https://www.mongodb.com/docs/manual/core/authentication-mechanisms-enterprise/#security-auth-ldap).
19-
lll_out="$(find . -type f -name "*_examples_test.go" | lll -w 4 -l 80 -e '^\s*\/\/.+:\/\/' --files)"
19+
lll_out="$(find "$@" -type f -name "*_examples_test.go" | lll -w 4 -l 80 -e '^\s*\/\/.+:\/\/' --files)"
2020

2121
if [[ $lll_out ]]; then
2222
echo "lll check failed for:";

mongo/crud_examples_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,8 @@ func ExampleClient_StartSession_withTransaction() {
749749
result, err := sess.WithTransaction(
750750
context.TODO(),
751751
func(sessCtx mongo.SessionContext) (interface{}, error) {
752-
// Use the mongo.SessionContext as the Context parameter for
753-
// InsertOne and FindOne so both operations are run in the same
754-
// transaction.
752+
// Use sessCtx as the Context parameter for InsertOne and FindOne so
753+
// both operations are run in a transaction.
755754

756755
coll := client.Database("db").Collection("coll")
757756
res, err := coll.InsertOne(sessCtx, bson.D{{"x", 1}})

mongo/integration/initial_dns_seedlist_discovery_test.go

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@ import (
1515
"runtime"
1616
"strings"
1717
"testing"
18-
"time"
1918

2019
"go.mongodb.org/mongo-driver/bson"
2120
"go.mongodb.org/mongo-driver/internal/testutil/assert"
22-
"go.mongodb.org/mongo-driver/mongo"
2321
"go.mongodb.org/mongo-driver/mongo/description"
2422
"go.mongodb.org/mongo-driver/mongo/integration/mtest"
2523
"go.mongodb.org/mongo-driver/mongo/options"
26-
"go.mongodb.org/mongo-driver/mongo/readpref"
2724
"go.mongodb.org/mongo-driver/x/mongo/driver/connstring"
2825
"go.mongodb.org/mongo-driver/x/mongo/driver/topology"
2926
)
@@ -40,26 +37,19 @@ type seedlistTest struct {
4037
NumHosts *int `bson:"numHosts"`
4138
Error bool `bson:"error"`
4239
Options bson.Raw `bson:"options"`
43-
Ping *bool `bson:"ping"`
4440
}
4541

4642
func TestInitialDNSSeedlistDiscoverySpec(t *testing.T) {
4743
mt := mtest.New(t, noClientOpts)
4844
defer mt.Close()
4945

5046
mt.RunOpts("replica set", mtest.NewOptions().Topologies(mtest.ReplicaSet).CreateClient(false), func(mt *mtest.T) {
51-
mt.Parallel()
52-
5347
runSeedlistDiscoveryDirectory(mt, "replica-set")
5448
})
5549
mt.RunOpts("sharded", mtest.NewOptions().Topologies(mtest.Sharded).CreateClient(false), func(mt *mtest.T) {
56-
mt.Parallel()
57-
5850
runSeedlistDiscoveryDirectory(mt, "sharded")
5951
})
6052
mt.RunOpts("load balanced", mtest.NewOptions().Topologies(mtest.LoadBalanced).CreateClient(false), func(mt *mtest.T) {
61-
mt.Parallel()
62-
6353
runSeedlistDiscoveryDirectory(mt, "load-balanced")
6454
})
6555
}
@@ -73,24 +63,6 @@ func runSeedlistDiscoveryDirectory(mt *mtest.T, subdirectory string) {
7363
}
7464
}
7565

76-
// runSeedlistDiscoveryPingTest will create a new connection using the test URI and attempt to "ping" the server.
77-
func runSeedlistDiscoveryPingTest(mt *mtest.T, clientOpts *options.ClientOptions) {
78-
ctx := context.Background()
79-
80-
client, err := mongo.Connect(ctx, clientOpts)
81-
assert.Nil(mt, err, "Connect error: %v", err)
82-
83-
defer func() { _ = client.Disconnect(ctx) }()
84-
85-
// Create a context with a timeout to prevent the ping operation from blocking indefinitely.
86-
pingCtx, cancel := context.WithTimeout(ctx, 1*time.Second)
87-
defer cancel()
88-
89-
// Ping the server.
90-
err = client.Ping(pingCtx, readpref.Nearest())
91-
assert.Nil(mt, err, "Ping error: %v", err)
92-
}
93-
9466
func runSeedlistDiscoveryTest(mt *mtest.T, file string) {
9567
content, err := ioutil.ReadFile(file)
9668
assert.Nil(mt, err, "ReadFile error for %v: %v", file, err)
@@ -159,10 +131,6 @@ func runSeedlistDiscoveryTest(mt *mtest.T, file string) {
159131
_, err := getServerByAddress(host, topo)
160132
assert.Nil(mt, err, "error finding host %q: %v", host, err)
161133
}
162-
163-
if ping := test.Ping; ping == nil || *ping {
164-
runSeedlistDiscoveryPingTest(mt, opts)
165-
}
166134
}
167135

168136
func buildSet(list []string) map[string]struct{} {
@@ -262,14 +230,6 @@ func getServerByAddress(address string, topo *topology.Topology) (description.Se
262230
if err != nil {
263231
return description.Server{}, err
264232
}
265-
266-
// If the selected server is a topology.SelectedServer, then we can get the description without creating a
267-
// connect pool.
268-
topologySelectedServer, ok := selectedServer.(*topology.SelectedServer)
269-
if ok {
270-
return topologySelectedServer.Description().Server, nil
271-
}
272-
273233
selectedServerConnection, err := selectedServer.Connection(context.Background())
274234
if err != nil {
275235
return description.Server{}, err

mongo/integration/retryable_writes_prose_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func TestRetryableWritesProse(t *testing.T) {
282282

283283
require.True(mt, secondFailPointConfigured)
284284

285-
// Assert that the "ShutdownInProgress" error is returned.
285+
// Assert that the "NotWritablePrimary" error is returned.
286286
require.True(mt, err.(mongo.WriteException).HasErrorCode(int(shutdownInProgressErrorCode)))
287287
})
288288
}

testdata/initial-dns-seedlist-discovery/load-balanced/loadBalanced-directConnection.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@
1010
"loadBalanced": true,
1111
"ssl": true,
1212
"directConnection": false
13-
},
14-
"ping": true
13+
}
1514
}

testdata/initial-dns-seedlist-discovery/load-balanced/loadBalanced-directConnection.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ options:
1111
loadBalanced: true
1212
ssl: true
1313
directConnection: false
14-
ping: true

testdata/initial-dns-seedlist-discovery/load-balanced/loadBalanced-true-txt.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99
"options": {
1010
"loadBalanced": true,
1111
"ssl": true
12-
},
13-
"ping": true
12+
}
1413
}

testdata/initial-dns-seedlist-discovery/load-balanced/loadBalanced-true-txt.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@ hosts:
88
options:
99
loadBalanced: true
1010
ssl: true
11-
ping: true

0 commit comments

Comments
 (0)