Skip to content

Commit 03f5e35

Browse files
author
Linas Naginionis
committed
Merge branch 'master' into linasn/query-handlers-refactoring
* master: [query] Remove dead code in prom package (#2871) Improve some slow tests (#2881) [coordinator] Set default namespace tag to avoid colliding with commonly used "namespace" label (#2878) [dbnode] Introduce Aggregator type (#2840) [dbnode] Refactor wide query path (#2826) [dbnode] Add validation to ensure index claims is singleton (#2877) [dbnode] Default HostID and Discovery config for minimal config (#2876)
2 parents a7d6696 + 78db238 commit 03f5e35

File tree

77 files changed

+1698
-3473
lines changed

Some content is hidden

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

77 files changed

+1698
-3473
lines changed

.golangci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ linters-settings:
108108
locale: US
109109
ignore-words:
110110
- someword
111+
exhaustive:
112+
default-signifies-exhaustive: true
111113
lll:
112114
# max line length, lines longer will be reported. Default is 120.
113115
# '\t' is counted as 1 character by default, and can be changed with the tab-width option
@@ -172,7 +174,6 @@ linters:
172174
- goconst
173175
- gocritic
174176
- gocyclo
175-
- godox
176177
- goimports
177178
- golint
178179
- gosimple
@@ -211,10 +212,17 @@ linters:
211212
- exhaustivestruct
212213
# We allow cuddling assignment following conditions because there are valid
213214
# logical groupings for this use-case (e.g. when evaluating config values).
214-
- wsl
215+
- wsl
216+
# Wrapcheck can cause errors until all callsites checking explicit error
217+
# types like io.EOF are converted to use errors.Is instead. Re-enable this
218+
# linter once all error checks are upgraded.
219+
- wrapcheck
220+
# godox prevents using TODOs or FIXMEs which can be useful for demarkation
221+
# of future work.
222+
- godox
215223
# New line required before return would require a large fraction of the
216224
# code base to need updating, it's not worth the perceived benefit.
217-
- nlreturn
225+
- nlreturn
218226
disable-all: false
219227
presets:
220228
# bodyclose, errcheck, gosec, govet, scopelint, staticcheck, typecheck

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ tools-linux-amd64:
165165
$(LINUX_AMD64_ENV) make tools
166166

167167
.PHONY: all
168-
all: lint test-ci-unit test-ci-integration services tools
168+
all: test-ci-unit test-ci-integration services tools
169169
@echo Made all successfully
170170

171171
.PHONY: install-tools
@@ -256,7 +256,7 @@ SUBDIR_TARGETS := \
256256
asset-gen \
257257
genny-gen \
258258
license-gen \
259-
all-gen \
259+
all-gen \
260260
lint
261261

262262
.PHONY: test-ci-unit
@@ -384,6 +384,7 @@ endef
384384

385385
# generate targets across SUBDIRS for each SUBDIR_TARGET. i.e. generate rules
386386
# which allow `make all-gen` to invoke `make all-gen-dbnode all-gen-coordinator ...`
387+
# NB: we skip lint explicity as it runs as a separate CI step.
387388
$(foreach SUBDIR_TARGET, $(SUBDIR_TARGETS), $(eval $(SUBDIR_TARGET_RULE)))
388389

389390
# Builds the single kube bundle from individual manifest files.
@@ -401,7 +402,7 @@ go-mod-tidy:
401402
.PHONY: all-gen
402403
all-gen: \
403404
install-tools \
404-
$(foreach SUBDIR_TARGET, $(SUBDIR_TARGETS), $(SUBDIR_TARGET)) \
405+
$(foreach SUBDIR_TARGET, $(filter-out lint all-gen,$(SUBDIR_TARGETS)), $(SUBDIR_TARGET)) \
405406
kube-gen-all \
406407
go-mod-tidy
407408

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ require (
119119
go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b
120120
go.uber.org/atomic v1.6.0
121121
go.uber.org/config v1.4.0
122+
go.uber.org/goleak v1.1.10
122123
go.uber.org/zap v1.13.0
123124
golang.org/x/net v0.0.0-20200822124328-c89045814202
124125
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208

go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,8 @@ go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
922922
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
923923
go.uber.org/config v1.4.0 h1:upnMPpMm6WlbZtXoasNkK4f0FhxwS+W4Iqz5oNznehQ=
924924
go.uber.org/config v1.4.0/go.mod h1:aCyrMHmUAc/s2h9sv1koP84M9ZF/4K+g2oleyESO/Ig=
925+
go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
926+
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
925927
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
926928
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
927929
go.uber.org/multierr v1.4.0 h1:f3WCSC2KzAcBXGATIxAB1E2XuCpNU255wNKZ505qi3E=
@@ -1069,6 +1071,7 @@ golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtn
10691071
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
10701072
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
10711073
golang.org/x/tools v0.0.0-20191104232314-dc038396d1f0/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
1074+
golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
10721075
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
10731076
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
10741077
golang.org/x/tools v0.0.0-20191203134012-c197fd4bf371/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=

src/cluster/kv/etcd/store_test.go

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@ import (
3535
"github.com/m3db/m3/src/cluster/kv"
3636
"github.com/m3db/m3/src/cluster/mocks"
3737
xclock "github.com/m3db/m3/src/x/clock"
38+
"github.com/m3db/m3/src/x/retry"
3839

39-
"go.etcd.io/etcd/clientv3"
40-
"go.etcd.io/etcd/integration"
4140
"github.com/coreos/pkg/capnslog"
4241
"github.com/golang/protobuf/proto"
4342
"github.com/stretchr/testify/require"
43+
"go.etcd.io/etcd/clientv3"
44+
"go.etcd.io/etcd/integration"
4445
"golang.org/x/net/context"
4546
)
4647

@@ -89,6 +90,8 @@ func TestGetAndSet(t *testing.T) {
8990
}
9091

9192
func TestNoCache(t *testing.T) {
93+
t.Parallel()
94+
9295
ec, opts, closeFn := testStore(t)
9396

9497
store, err := NewStore(ec, ec, opts)
@@ -155,6 +158,8 @@ func TestCacheDirCreation(t *testing.T) {
155158
}
156159

157160
func TestCache(t *testing.T) {
161+
t.Parallel()
162+
158163
ec, opts, closeFn := testStore(t)
159164

160165
f, err := ioutil.TempFile("", "")
@@ -207,6 +212,8 @@ func TestCache(t *testing.T) {
207212
}
208213

209214
func TestSetIfNotExist(t *testing.T) {
215+
t.Parallel()
216+
210217
ec, opts, closeFn := testStore(t)
211218
defer closeFn()
212219

@@ -226,6 +233,8 @@ func TestSetIfNotExist(t *testing.T) {
226233
}
227234

228235
func TestCheckAndSet(t *testing.T) {
236+
t.Parallel()
237+
229238
ec, opts, closeFn := testStore(t)
230239
defer closeFn()
231240

@@ -252,6 +261,8 @@ func TestCheckAndSet(t *testing.T) {
252261
}
253262

254263
func TestWatchClose(t *testing.T) {
264+
t.Parallel()
265+
255266
ec, opts, closeFn := testStore(t)
256267
defer closeFn()
257268

@@ -280,6 +291,7 @@ func TestWatchClose(t *testing.T) {
280291
if !ok {
281292
break
282293
}
294+
time.Sleep(1 * time.Millisecond)
283295
}
284296

285297
// getting a new watch will create a new watchale and thread to watch for updates
@@ -300,6 +312,8 @@ func TestWatchClose(t *testing.T) {
300312
}
301313

302314
func TestWatchLastVersion(t *testing.T) {
315+
t.Parallel()
316+
303317
ec, opts, closeFn := testStore(t)
304318
defer closeFn()
305319

@@ -311,7 +325,7 @@ func TestWatchLastVersion(t *testing.T) {
311325
require.Nil(t, w.Get())
312326

313327
var errs int32
314-
lastVersion := 100
328+
lastVersion := 50
315329
go func() {
316330
for i := 1; i <= lastVersion; i++ {
317331
_, err := store.Set("foo", genProto(fmt.Sprintf("bar%d", i)))
@@ -334,6 +348,8 @@ func TestWatchLastVersion(t *testing.T) {
334348
}
335349

336350
func TestWatchFromExist(t *testing.T) {
351+
t.Parallel()
352+
337353
ec, opts, closeFn := testStore(t)
338354
defer closeFn()
339355

@@ -371,6 +387,8 @@ func TestWatchFromExist(t *testing.T) {
371387
}
372388

373389
func TestWatchFromNotExist(t *testing.T) {
390+
t.Parallel()
391+
374392
ec, opts, closeFn := testStore(t)
375393
defer closeFn()
376394

@@ -414,6 +432,8 @@ func TestGetFromKvNotFound(t *testing.T) {
414432
}
415433

416434
func TestMultipleWatchesFromExist(t *testing.T) {
435+
t.Parallel()
436+
417437
ec, opts, closeFn := testStore(t)
418438
defer closeFn()
419439

@@ -464,6 +484,8 @@ func TestMultipleWatchesFromExist(t *testing.T) {
464484
}
465485

466486
func TestMultipleWatchesFromNotExist(t *testing.T) {
487+
t.Parallel()
488+
467489
ec, opts, closeFn := testStore(t)
468490
defer closeFn()
469491

@@ -506,6 +528,8 @@ func TestMultipleWatchesFromNotExist(t *testing.T) {
506528
}
507529

508530
func TestWatchNonBlocking(t *testing.T) {
531+
t.Parallel()
532+
509533
ec, opts, closeFn := testStore(t)
510534
defer closeFn()
511535

@@ -1093,7 +1117,7 @@ func TestWatchWithStartRevision(t *testing.T) {
10931117
store, err := NewStore(ec, ec, opts)
10941118
require.NoError(t, err)
10951119

1096-
for i := 1; i <= 100; i++ {
1120+
for i := 1; i <= 50; i++ {
10971121
_, err = store.Set("foo", genProto(fmt.Sprintf("bar-%d", i)))
10981122
require.NoError(t, err)
10991123
}
@@ -1110,7 +1134,7 @@ func TestWatchWithStartRevision(t *testing.T) {
11101134
w1, err := store.Watch("foo")
11111135
require.NoError(t, err)
11121136
<-w1.C()
1113-
verifyValue(t, w1.Get(), "bar-100", 100)
1137+
verifyValue(t, w1.Get(), "bar-50", 50)
11141138
})
11151139
}
11161140

@@ -1137,7 +1161,11 @@ func testStore(t *testing.T) (*clientv3.Client, Options, func()) {
11371161
}
11381162

11391163
opts := NewOptions().
1140-
SetWatchChanCheckInterval(10 * time.Millisecond).
1164+
SetWatchChanCheckInterval(50 * time.Millisecond).
1165+
SetWatchChanResetInterval(150 * time.Millisecond).
1166+
SetWatchChanInitTimeout(150 * time.Millisecond).
1167+
SetRequestTimeout(100 * time.Millisecond).
1168+
SetRetryOptions(retry.NewOptions().SetMaxRetries(1).SetMaxBackoff(0)).
11411169
SetPrefix("test")
11421170

11431171
return ec, opts, closer

0 commit comments

Comments
 (0)