File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ EXAMPLES_TEST_PKGS = $(shell etc/list_test_pkgs.sh ./examples)
13
13
PKGS = $(BSON_PKGS ) $(EVENT_PKGS ) $(MONGO_PKGS ) $(UNSTABLE_PKGS ) $(TAG_PKG ) $(EXAMPLES_PKGS )
14
14
TEST_PKGS = $(BSON_TEST_PKGS ) $(EVENT_TEST_PKGS ) $(MONGO_TEST_PKGS ) $(UNSTABLE_TEST_PKGS ) $(TAG_PKG ) $(EXAMPLES_TEST_PKGS )
15
15
ATLAS_URIS = "$(ATLAS_FREE ) " "$(ATLAS_REPLSET ) " "$(ATLAS_SHARD ) " "$(ATLAS_TLS11 ) " "$(ATLAS_TLS12 ) " "$(ATLAS_FREE_SRV ) " "$(ATLAS_REPLSET_SRV ) " "$(ATLAS_SHARD_SRV ) " "$(ATLAS_TLS11_SRV ) " "$(ATLAS_TLS12_SRV ) " "$(ATLAS_SERVERLESS ) " "$(ATLAS_SERVERLESS_SRV ) "
16
+ GODISTS =linux/amd64 linux/386 linux/arm64 linux/arm linux/s390x
16
17
17
18
TEST_TIMEOUT = 1800
18
19
59
60
60
61
.PHONY : lint
61
62
lint :
62
- golangci-lint run --config .golangci.yml ./...
63
+ for dist in $( GODISTS) ; do \
64
+ goos=$$(echo $$dist | cut -d/ -f 1 ) ; \
65
+ goarch=$$(echo $$dist | cut -d/ -f 2 ) ; \
66
+ command=" GOOS=$$ goos GOARCH=$$ goarch golangci-lint run --config .golangci.yml ./..." ; \
67
+ echo $$ command ; \
68
+ eval $$ command ; \
69
+ done
63
70
64
71
.PHONY : test
65
72
test :
Original file line number Diff line number Diff line change @@ -84,6 +84,12 @@ type WriteConcernErrorData struct {
84
84
85
85
// T is a wrapper around testing.T.
86
86
type T struct {
87
+ // connsCheckedOut is the net number of connections checked out during test execution.
88
+ // It must be accessed using the atomic package and should be at the beginning of the struct.
89
+ // - atomic bug: https://pkg.go.dev/sync/atomic#pkg-note-BUG
90
+ // - suggested layout: https://go101.org/article/memory-layout.html
91
+ connsCheckedOut int64
92
+
87
93
* testing.T
88
94
89
95
// members for only this T instance
@@ -104,7 +110,6 @@ type T struct {
104
110
dataLake * bool
105
111
ssl * bool
106
112
collCreateOpts bson.D
107
- connsCheckedOut int64 // net number of connections checked out during test execution
108
113
requireAPIVersion * bool
109
114
110
115
// options copied to sub-tests
Original file line number Diff line number Diff line change @@ -82,10 +82,15 @@ func connectionStateString(state int64) string {
82
82
83
83
// Server is a single server within a topology.
84
84
type Server struct {
85
- cfg * serverConfig
86
- address address.Address
85
+ // connectionstate must be accessed using the atomic package and should be at the beginning of
86
+ // the struct.
87
+ // - atomic bug: https://pkg.go.dev/sync/atomic#pkg-note-BUG
88
+ // - suggested layout: https://go101.org/article/memory-layout.html
87
89
connectionstate int64
88
90
91
+ cfg * serverConfig
92
+ address address.Address
93
+
89
94
// connection related fields
90
95
pool * pool
91
96
You can’t perform that action at this time.
0 commit comments