Commit Graph

16418 Commits (bc9e433ca26be0314a37c8c6ead66429a584bbc9)

Author SHA1 Message Date
Piotr Tabor 98b123f034 mvcc: Fix races between metrics gathering and mvcc.Restore
The races was manifesting as following flakes:

```
```
See:
  https://github.com/etcd-io/etcd/issues/12336

I'm taking the locks for short-duration of time (instead of the whole
duriation of Restore) to allow metrics being gather when the server
restoration is in progress.

```
{"level":"warn","ts":"2020-09-26T13:33:13.010Z","caller":"clientv3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"endpoint://client-c9c21e47-2013-4776-8e83-e331b2caa9ae/localhost:14422410081761184170","attempt":0,"error":"rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial unix localhost:14422410081761184170: connect: no such file or directory\""}
{"level":"warn","ts":"2020-09-26T13:33:13.011Z","caller":"clientv3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"endpoint://client-c9c21e47-2013-4776-8e83-e331b2caa9ae/localhost:14422410081761184170","attempt":0,"error":"rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial unix localhost:14422410081761184170: connect: no such file or directory\""}
{"level":"warn","ts":"2020-09-26T13:33:16.285Z","caller":"clientv3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"endpoint://client-b504e954-e000-42a4-aa4f-70ded8dbef39/localhost:55672762955698614610","attempt":0,"error":"rpc error: code = NotFound desc = etcdserver: requested lease not found"}
{"level":"warn","ts":"2020-09-26T13:33:21.434Z","caller":"clientv3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"endpoint://client-7945004b-f67e-42aa-af11-a7b40fbbe6fc/localhost:49623072144007561240","attempt":0,"error":"rpc error: code = Canceled desc = context canceled"}
==================
WARNING: DATA RACE
Write at 0x00c000905f78 by goroutine 764:
  go.etcd.io/etcd/v3/mvcc.(*store).restore()
      /go/src/go.etcd.io/etcd/mvcc/kvstore.go:397 +0x773
  go.etcd.io/etcd/v3/mvcc.(*store).Restore()
      /go/src/go.etcd.io/etcd/mvcc/kvstore.go:343 +0x5f1
  go.etcd.io/etcd/v3/mvcc.(*watchableStore).Restore()
      /go/src/go.etcd.io/etcd/mvcc/watchable_store.go:199 +0xe2
  go.etcd.io/etcd/v3/etcdserver.(*EtcdServer).applySnapshot()
      /go/src/go.etcd.io/etcd/etcdserver/server.go:1107 +0xa49
  go.etcd.io/etcd/v3/etcdserver.(*EtcdServer).applyAll()
      /go/src/go.etcd.io/etcd/etcdserver/server.go:1031 +0x6d
  go.etcd.io/etcd/v3/etcdserver.(*EtcdServer).run.func8()
      /go/src/go.etcd.io/etcd/etcdserver/server.go:986 +0x53
  go.etcd.io/etcd/v3/pkg/schedule.(*fifo).run()
      /go/src/go.etcd.io/etcd/pkg/schedule/schedule.go:157 +0x11e
Previous read at 0x00c000905f78 by goroutine 180:
  [failed to restore the stack]
Goroutine 764 (running) created at:
  go.etcd.io/etcd/v3/pkg/schedule.NewFIFOScheduler()
      /go/src/go.etcd.io/etcd/pkg/schedule/schedule.go:70 +0x2b1
  go.etcd.io/etcd/v3/etcdserver.(*EtcdServer).run()
      /go/src/go.etcd.io/etcd/etcdserver/server.go:871 +0x32c
Goroutine 180 (running) created at:
  net/http.(*Server).Serve()
      /usr/local/go/src/net/http/server.go:2933 +0x5b6
  net/http/httptest.(*Server).goServe.func1()
      /usr/local/go/src/net/http/httptest/server.go:308 +0xd3
==================
--- FAIL: TestV3WatchRestoreSnapshotUnsync (6.74s)
    testing.go:906: race detected during execution of test
FAIL
coverage: 83.5% of statements
FAIL	go.etcd.io/etcd/v3/integration	231.272s
FAIL
Command 'go test -timeout=30m -cpu=1 --race --cover=true go.etcd.io/etcd/v3/integration' failed.
```
2020-10-03 19:39:08 +02:00
Piotr Tabor 220f711a2a clientv3/integration: Fix leaked goroutine in case of skipped test. 2020-10-03 19:38:54 +02:00
Piotr Tabor 528f5315d6 auth: Fix "race" - auth unit tests leaking goroutines
- We were leaking goroutines in auth-test
  - The go-routines were depending / modifying global test environment
variables (simpleTokenTTLDefault) leading to races

Removed the leaked go-routines, and expanded 'auth' package to
be covered we leaked go-routines detection.
2020-10-03 19:38:30 +02:00
Piotr Tabor 0e5d81704f .travis.yml, scripts: Fix minor bugs in the test script.
1. setting environment variable cannot be in quote
2. "--race" testing for unit tests is supposed to be part of linux-amd64-unit-4-cpu-race config.
3. 'run' function in test script should log_error in case of failed
command (wrong operator for ints comparison in bash).
2020-10-01 14:34:58 +02:00
CFC4N b0e8ec951c
CHANGELOG: update for #12165 , #12264 . 2020-09-30 16:57:15 +08:00
vivian ab4cc3caef
raft/log: remove redundant code logic (#12346)
Remove redundant code logic

Co-authored-by: yangweiwei <yangweiwei@cmss.chinamobile.com>
2020-09-29 19:48:32 -07:00
Piotr Tabor a6b0375b7b
Travis: Reduce footprint of unit tests - so hopefully flakiness (#12350)
* ./tests: Remove legacy coverage collection code

The legacy tests/cover.test.bash script was not ./test script
compatible for a long time.

The following method of coverage collection works (also across
packages) and does not make all the test execution slower.

```
COVERDIR=coverage PASSES="build build_cov cov" ./test
go tool cover -html ./coverage/cover.out
```

* CI: Reduce duplicated coverage between different variants on Travis

We used to execute unit tests in 3 different jobs,
every time with --race detection and every time in 3 variants:1,2,4
CPUS.

The proposed change makes each of the jobs use different variant of
CPUS, and only 4-cpu variant is running with --race detection
(as the more-parallel variant is more likely to experience races),
2020-09-29 19:47:05 -07:00
Joe Betz b47cd2f470
Merge pull request #12322 from ptabor/20200920-test-script
./test: Refactoring of test script for modularization
2020-09-29 11:09:24 -04:00
Naga Ravi Chaitanya Elluri 3022bd73ce Documentation/etcd-mixin/mixin.libsonnet: Add alerts for etcd fsync duration
This commit adds support to check the 99th percentile of the etcd
members fsync duration and fires a critical alert when it is greater
than 1 sec. The recommended fsync for etcd is 20 ms but there might
be scenarios where a user might be using bad disks for reasons. This
will make sure to let the user/admin know that it is critical for
etcd performance.
2020-09-28 08:08:20 -04:00
Piotr Tabor b3bbe10465 go.sum: Update & make sure PASSES="mod_tidy" ./test detects such problems.
Commit inspired by this failure:
  https://travis-ci.com/github/etcd-io/etcd/jobs/391164537

This is not happanning locally - but can be forced by removal of go.sum
file. Let's watch how frequently we will need to refresh go.sum.
2020-09-28 12:00:25 +02:00
Piotr Tabor f1d4593241 ./test: Refactoring of test script for modularization
This refactoring offers following benefits:

  - Unified way how go test commands are being called (in terms of flags intepretation)
  - Uses standard go mechanisms (like go lists) to find files/packages that are subject for test. The mechanism are module aware.
  - Added instruction how to install tools needed for the tests/checkers.
  - Added colors to the output to make it easier to spot any failure.

Confirmed to work using:
- COVERDIR="./coverage" CPU="4" RACE=false COVER=false PASSES="build build_cov cov" ./test
- CPU="4" RACE=false COVER=false PASSES="e2e functional integration" ./test
- COVERDIR="./coverage" COVER="false" CPU="4" RACE="false" PASSES="fmt build unit build_cov integration e2e integration_e2e grpcproxy cov" ./test
- PASSES=unit PKG=./wal TIMEOUT=1m ./test
- PASSES=integration PKG=./clientv3 TIMEOUT=1m ./test
- PASSES=unit PKG=./wal TESTCASE=TestNew TIMEOUT=1m ./test
- PASSES=unit PKG=./wal TESTCASE="\bTestNew\b" TIMEOUT=1m ./test
- PASSES=integration PKG=./client/integration TESTCASE="\bTestV2NoRetryEOF\b" TIMEOUT=1m ./test
- COVERDIR=coverage PASSES="build_cov cov" ./test
2020-09-28 11:07:50 +02:00
Pierre Zemb cc2b4cd05e
etcdserver: add more detailed traces on linearized reading (#12335)
To improve debuggability of `agreement among raft nodes before
linearized reading`, we added some tracing inside
`linearizableReadLoop`.

This will allow us to know the timing of `s.r.ReadIndex` vs
`s.applyWait.Wait(rs.Index)`.
2020-09-26 19:08:36 -07:00
Piotr Tabor 31426b0041 clientv3/ordering: Split mocked part of the test from integration-level test. 2020-09-26 08:44:58 +02:00
Piotr Tabor d65b5d6791 Makefile: Improve the 'make clean' to remove all the tmp artifacts 2020-09-25 22:20:52 +02:00
Piotr Tabor 16eeedffaa pkg/testutil: Fixing flakes due to >>leak" text/template/parse goroutines.
Examplar flake: https://travis-ci.com/github/etcd-io/etcd/jobs/388806782
```
go test -timeout=5m -cpu=1 --run=Example ./client/...

ok  	go.etcd.io/etcd/v3/client	0.085s
testing: warning: no tests to run
PASS
Unexpected goroutines running after all test(s).
1 instances of:
text/template/parse.(*lexer).emit(...)
	/usr/local/go/src/text/template/parse/lex.go:157
text/template/parse.lexText(...)
	/usr/local/go/src/text/template/parse/lex.go:269 +0x4f0
text/template/parse.(*lexer).run(...)
	/usr/local/go/src/text/template/parse/lex.go:230 +0x37
created by text/template/parse.lex
	/usr/local/go/src/text/template/parse/lex.go:223 +0x190
FAIL	go.etcd.io/etcd/v3/client/integration	0.013s
```
2020-09-25 22:10:43 +02:00
Piotr Tabor 73e5714bc5
integration: 'go test -tags cluster_proxy -v ./integration/... ./clientv3/...' passes now. (#12319)
The grpc-proxy test logic was assuming that the context associated to client is closed,
while in practice all tests called client.Close() without explicit context close.

The current testing strategy is complicated 2 fold:
  - grpc proxy works like man-in-the middle of each Connection issues
from integration tests and its lifetime is bound to the connection.
  - both connections (client -> proxy, and proxy -> etcd-server) are
represented by the same ClientV3 object instance (with substituted
implementations of KV or watcher).

The fix splits context representing proxy from context representing proxy -> etcd-server connection,
thus allowing cancelation of the proxy context.
2020-09-25 12:18:58 -07:00
mlmhl 3f36143790
pkg/traceutil: skip subTraceStart/subTraceEnd steps when logging steps (#12262)
SubTraceStart and SubTraceEnd steps are only placeholders, not really
steps, we should skip them when logging the long duration steps,
otherwise these steps will lead to incorrect start time and duration
 of subsequent steps.
2020-09-25 11:46:06 -07:00
Piotr Tabor 7bf75824bf
CHANGELOG: Update changelog about modules instead of ./vendor (#12313)
Follow up to PR: https://github.com/etcd-io/etcd/pull/12279
2020-09-25 11:29:51 -07:00
Naga Ravi Chaitanya Elluri ed82418799
Documentation: Add etcd database quota alerts (#12249)
This commit:
- Fires a critical alert when the etcd database quota is 95% full
  at any given point of time to alert the user to defrag or increase
  the quota in order to avoid the alarm getting triggered which blocks
  all the writes to etcd meaning there can't be any new objects created.
  This is needed to make sure the cluster supports running large number
  of nodes and objects.
- Fires a warning when there is a sudden surge in etcd writes leading to
  increase in the etcd database quota size at an alarming rate as it
  is disruptive. It might be because of a rougue process and it's
  important to alert the admin.
2020-09-25 11:03:04 -07:00
CFC4N 8050881aaf
clientv3:get AuthToken gracefully without extra connection. (#12165)
* etcdserver: check authinfo if it is not InternalAuthenticateRequest.

* credentials: let GetRequestMetadata() return nil when authToken isn't initialized.

* clientv3: get AuthToken gracefully without extra connection.
2020-09-25 11:01:54 -07:00
Paweł Krupa 74fea11ddc
Documentation/etcd-mixin: Adhere to monitoring mixins annotation guidelines (#12224)
* replaced `message` annotation field with `description`
* added simple `summary` field

Signed-off-by: paulfantom <pawel@krupa.net.pl>
2020-09-25 10:56:52 -07:00
Tobias Klauser add86bbd1a
pkg/fileutil: use fcntl syscall wrappers from golang.org/x/sys/unix (#12316)
Direct syscalls using syscall.Syscall(SYS_*, ...) should no longer be
used on darwin, see [1]. Instead, use the fcntl libSystem wrappers
provided by the golang.org/x/sys/unix package which implement the same
functionality.

[1] https://golang.org/doc/go1.12#darwin
2020-09-24 23:02:32 -07:00
yofan 4136df7933
lease: fix lease expiry bases on wall clock (#12292)
fix https://github.com/etcd-io/etcd/issues/12291
2020-09-24 22:59:25 -07:00
CFC4N 8c192d99df
clientv3: get AuthToken automatically when clientConn is ready. (#12264)
fixes: #11954
2020-09-24 22:43:21 -07:00
Jingyi Hu 205a656cc5
Merge pull request #11853 from viviyww/dev1
tools: fix test case errors in etcd-dump-logs
2020-09-21 09:13:31 -07:00
Jingyi Hu 353fcf0924
Merge pull request #12314 from viviyww/incorrect-log
etcdserver: fix log info error
2020-09-21 03:17:59 -07:00
Jingyi Hu de1550d7c8
Merge pull request #12318 from ptabor/20200920-leak-detection-flake-fix
pkg/testutil: Ignore flakes due to "leaked" testing.runTests goroutine
2020-09-21 01:22:06 -07:00
yangweiwei ff516e3a36 etcdserver: fix log info error
etcdserver#util.go#warnOfExpensiveReadOnlyTxnRequest logs with wrong prefix "read-only range ".
It has to be "read-only txn ".

fixes #12295
2020-09-21 16:00:01 +08:00
yangweiwei c88d1497ee tools: fix test case errors in etcd-dump-logs
Fix test case errors in etcd-dump-logs and the error is the time zone.
When the GOST time zone is CST or PST and the test case will be failed.
So we should set UTC as the standard time zone.
2020-09-21 15:54:47 +08:00
Jingyi Hu 14566556f3
Merge pull request #12283 from teddylear/feature/FixPortOnTest
embed: TestStartEtcdWrongToken now uses dynamic ports instead of default
2020-09-20 08:30:48 -07:00
Jingyi Hu 132098b028
Merge pull request #12311 from ptabor/20200917-proxy-watcher-progress-panic
integration,proxy: Skip WatchRequestProgress test in grpc-proxy mode.
2020-09-20 08:07:20 -07:00
teddylear 3b92b9f884 embed: TestStartEtcdWrongToken now uses dynamic ports instead of default
To avoid issues with a test failing due to port conflict when etcd is
already running, this test now uses dynamic ports instead.

Fixes #11956
2020-09-19 11:29:22 -04:00
Piotr Tabor 5f9a1394db integration,proxy: Skip WatchRequestProgress test in grpc-proxy mode.
Fixes:
  go test -tags cluster_proxy ./clientv3/integration -v -run TestWatchRequestProgress

Does not fail the grpc-server (completely) by a not implemented RPC.
Failing whole server by remote request is anti-pattern and security
risk.

Prior to the fix, the command line above was failing with:

```
=== RUN   TestWatchRequestProgress/0-watcher
panic: not implemented

goroutine 602 [running]:
go.etcd.io/etcd/v3/proxy/grpcproxy.(*watchProxyStream).recvLoop(0xc0004779d0, 0x0, 0x0)
	/home/ptab/corp/etcd/proxy/grpcproxy/watch.go:275 +0xac5
go.etcd.io/etcd/v3/proxy/grpcproxy.(*watchProxy).Watch.func1(0xc0034f94a0, 0xc0004779d0)
	/home/ptab/corp/etcd/proxy/grpcproxy/watch.go:129 +0x53
created by go.etcd.io/etcd/v3/proxy/grpcproxy.(*watchProxy).Watch
	/home/ptab/corp/etcd/proxy/grpcproxy/watch.go:127 +0x3c8
FAIL	go.etcd.io/etcd/v3/clientv3/integration	0.215s
FAIL
```
2020-09-19 17:27:07 +02:00
Piotr Tabor 04b91945f4 pkg/testutil: Ignore flakes due to "leaked" testing.runTests goroutine.
The flake happened e.g. in:
https://travis-ci.com/github/etcd-io/etcd/jobs/386607570

```
--- PASS: TestWatchClose (0.37s)
PASS
Unexpected goroutines running after all test(s).
1 instances of:
testing.runTests.func1.1(...)
	/usr/local/go/src/testing/testing.go:1289 +0x60
created by testing.runTests.func1
	/usr/local/go/src/testing/testing.go:1289 +0xdb
FAIL	go.etcd.io/etcd/v3/clientv3/integration	344.389s
FAIL
```

This is implementation detail of Go testing.lib and we should not worry.
2020-09-19 17:16:21 +02:00
Jingyi Hu 6d5b77b91b
Merge pull request #12315 from BinacsLee/binacs-mvcc-fix-typo
mvcc: fix typo
2020-09-18 09:17:59 -07:00
Binacs Lee 6968c45f58 mvcc: fix typo 2020-09-18 06:50:56 +00:00
Sahdev Zala 588c021ddb
Merge pull request #12308 from zcchew1202/readme-fix
Doc: Add that grpc-proxy is optional in readme
2020-09-17 16:29:18 -04:00
Zi Chien Chew be348f0ea6 Doc: Add that grpc-proxy is optional in readme
The script allows optionally enabling `grpc-proxy` so reflecting it in the doc…
2020-09-17 12:13:18 -04:00
Jingyi Hu 528b01c327
Merge pull request #12303 from ptabor/20200915-v3compactor-metric-reporting
etcdserver: v3compactor should use proper clock for latency (took) reporting
2020-09-17 02:26:56 -07:00
Jingyi Hu 2fee6bd5f3
Merge pull request #12279 from ptabor/20200908-no-vendor
vendor: Get rid of ./vendor
2020-09-17 02:21:56 -07:00
Jingyi Hu 3e1a64913a
Merge pull request #12286 from ptabor/20200911-short-test-separated
*: 'go test --short ./...' runs all UNIT tests in <25s
2020-09-16 05:16:18 -07:00
Piotr Tabor 3f449a8548 *: 'go test --short ./...' runs all UNIT tests.
Marked all 'integrational, e2e' as skipped in the --short mode.

Thanks to this we will be able to significantly simplify ./test script.

The run currently takes ~23s.
With (follow up) move of ~clientv3/snapshot to integration tests (as
part of modularization), we can expect this to fall to 5-10s.

```
% time go test --short ./... --count=1
ok  	go.etcd.io/etcd/v3	0.098s
?   	go.etcd.io/etcd/v3/Documentation/learning/lock/client	[no test files]
?   	go.etcd.io/etcd/v3/Documentation/learning/lock/storage	[no test files]
ok  	go.etcd.io/etcd/v3/auth	0.724s
?   	go.etcd.io/etcd/v3/auth/authpb	[no test files]
ok  	go.etcd.io/etcd/v3/client	0.166s
ok  	go.etcd.io/etcd/v3/client/integration	0.166s
ok  	go.etcd.io/etcd/v3/clientv3	3.219s
ok  	go.etcd.io/etcd/v3/clientv3/balancer	1.102s
?   	go.etcd.io/etcd/v3/clientv3/balancer/connectivity	[no test files]
?   	go.etcd.io/etcd/v3/clientv3/balancer/picker	[no test files]
?   	go.etcd.io/etcd/v3/clientv3/balancer/resolver/endpoint	[no test files]
ok  	go.etcd.io/etcd/v3/clientv3/clientv3util	0.096s [no tests to run]
ok  	go.etcd.io/etcd/v3/clientv3/concurrency	3.323s
?   	go.etcd.io/etcd/v3/clientv3/credentials	[no test files]
ok  	go.etcd.io/etcd/v3/clientv3/integration	0.131s
?   	go.etcd.io/etcd/v3/clientv3/leasing	[no test files]
?   	go.etcd.io/etcd/v3/clientv3/mirror	[no test files]
ok  	go.etcd.io/etcd/v3/clientv3/namespace	0.041s
ok  	go.etcd.io/etcd/v3/clientv3/naming	0.115s
ok  	go.etcd.io/etcd/v3/clientv3/ordering	0.121s
ok  	go.etcd.io/etcd/v3/clientv3/snapshot	19.325s
ok  	go.etcd.io/etcd/v3/clientv3/yaml	0.090s
ok  	go.etcd.io/etcd/v3/contrib/raftexample	7.572s
?   	go.etcd.io/etcd/v3/contrib/recipes	[no test files]
ok  	go.etcd.io/etcd/v3/embed	0.282s
ok  	go.etcd.io/etcd/v3/etcdctl	0.054s
?   	go.etcd.io/etcd/v3/etcdctl/ctlv2	[no test files]
ok  	go.etcd.io/etcd/v3/etcdctl/ctlv2/command	0.117s
?   	go.etcd.io/etcd/v3/etcdctl/ctlv3	[no test files]
ok  	go.etcd.io/etcd/v3/etcdctl/ctlv3/command	0.070s
ok  	go.etcd.io/etcd/v3/etcdmain	0.172s
ok  	go.etcd.io/etcd/v3/etcdserver	1.698s
?   	go.etcd.io/etcd/v3/etcdserver/api	[no test files]
ok  	go.etcd.io/etcd/v3/etcdserver/api/etcdhttp	0.075s
ok  	go.etcd.io/etcd/v3/etcdserver/api/membership	0.104s
?   	go.etcd.io/etcd/v3/etcdserver/api/membership/membershippb	[no test files]
ok  	go.etcd.io/etcd/v3/etcdserver/api/rafthttp	0.181s
ok  	go.etcd.io/etcd/v3/etcdserver/api/snap	0.078s
?   	go.etcd.io/etcd/v3/etcdserver/api/snap/snappb	[no test files]
ok  	go.etcd.io/etcd/v3/etcdserver/api/v2auth	0.142s
ok  	go.etcd.io/etcd/v3/etcdserver/api/v2discovery	0.035s
ok  	go.etcd.io/etcd/v3/etcdserver/api/v2error	0.043s
ok  	go.etcd.io/etcd/v3/etcdserver/api/v2http	0.070s
ok  	go.etcd.io/etcd/v3/etcdserver/api/v2http/httptypes	0.031s
?   	go.etcd.io/etcd/v3/etcdserver/api/v2stats	[no test files]
ok  	go.etcd.io/etcd/v3/etcdserver/api/v2store	0.645s
ok  	go.etcd.io/etcd/v3/etcdserver/api/v2v3	0.218s
?   	go.etcd.io/etcd/v3/etcdserver/api/v3alarm	[no test files]
?   	go.etcd.io/etcd/v3/etcdserver/api/v3client	[no test files]
ok  	go.etcd.io/etcd/v3/etcdserver/api/v3compactor	1.765s
?   	go.etcd.io/etcd/v3/etcdserver/api/v3election	[no test files]
?   	go.etcd.io/etcd/v3/etcdserver/api/v3election/v3electionpb	[no test files]
?   	go.etcd.io/etcd/v3/etcdserver/api/v3election/v3electionpb/gw	[no test files]
?   	go.etcd.io/etcd/v3/etcdserver/api/v3lock	[no test files]
?   	go.etcd.io/etcd/v3/etcdserver/api/v3lock/v3lockpb	[no test files]
?   	go.etcd.io/etcd/v3/etcdserver/api/v3lock/v3lockpb/gw	[no test files]
ok  	go.etcd.io/etcd/v3/etcdserver/api/v3rpc	0.091s
ok  	go.etcd.io/etcd/v3/etcdserver/api/v3rpc/rpctypes	0.012s
ok  	go.etcd.io/etcd/v3/etcdserver/cindex	0.054s
ok  	go.etcd.io/etcd/v3/etcdserver/etcdserverpb	0.039s
?   	go.etcd.io/etcd/v3/etcdserver/etcdserverpb/gw	[no test files]
ok  	go.etcd.io/etcd/v3/functional/agent	0.094s
?   	go.etcd.io/etcd/v3/functional/cmd/etcd-agent	[no test files]
?   	go.etcd.io/etcd/v3/functional/cmd/etcd-proxy	[no test files]
?   	go.etcd.io/etcd/v3/functional/cmd/etcd-runner	[no test files]
?   	go.etcd.io/etcd/v3/functional/cmd/etcd-tester	[no test files]
ok  	go.etcd.io/etcd/v3/functional/rpcpb	0.060s
?   	go.etcd.io/etcd/v3/functional/runner	[no test files]
ok  	go.etcd.io/etcd/v3/functional/tester	0.079s
ok  	go.etcd.io/etcd/v3/integration	0.684s
ok  	go.etcd.io/etcd/v3/integration/embed	0.101s
ok  	go.etcd.io/etcd/v3/lease	3.455s
ok  	go.etcd.io/etcd/v3/lease/leasehttp	2.185s
?   	go.etcd.io/etcd/v3/lease/leasepb	[no test files]
ok  	go.etcd.io/etcd/v3/mvcc	7.246s
ok  	go.etcd.io/etcd/v3/mvcc/backend	0.354s
?   	go.etcd.io/etcd/v3/mvcc/mvccpb	[no test files]
ok  	go.etcd.io/etcd/v3/pkg/adt	0.025s
?   	go.etcd.io/etcd/v3/pkg/contention	[no test files]
?   	go.etcd.io/etcd/v3/pkg/cpuutil	[no test files]
ok  	go.etcd.io/etcd/v3/pkg/crc	0.008s
?   	go.etcd.io/etcd/v3/pkg/debugutil	[no test files]
ok  	go.etcd.io/etcd/v3/pkg/expect	0.015s
ok  	go.etcd.io/etcd/v3/pkg/fileutil	0.268s
ok  	go.etcd.io/etcd/v3/pkg/flags	0.021s
ok  	go.etcd.io/etcd/v3/pkg/httputil	0.020s
ok  	go.etcd.io/etcd/v3/pkg/idutil	0.008s
ok  	go.etcd.io/etcd/v3/pkg/ioutil	0.025s
ok  	go.etcd.io/etcd/v3/pkg/logutil	0.047s
?   	go.etcd.io/etcd/v3/pkg/mock/mockserver	[no test files]
?   	go.etcd.io/etcd/v3/pkg/mock/mockstorage	[no test files]
?   	go.etcd.io/etcd/v3/pkg/mock/mockstore	[no test files]
?   	go.etcd.io/etcd/v3/pkg/mock/mockwait	[no test files]
ok  	go.etcd.io/etcd/v3/pkg/netutil	1.024s
ok  	go.etcd.io/etcd/v3/pkg/osutil	0.021s
ok  	go.etcd.io/etcd/v3/pkg/pathutil	0.008s
ok  	go.etcd.io/etcd/v3/pkg/pbutil	0.008s
ok  	go.etcd.io/etcd/v3/pkg/proxy	4.081s
ok  	go.etcd.io/etcd/v3/pkg/report	0.008s
?   	go.etcd.io/etcd/v3/pkg/runtime	[no test files]
ok  	go.etcd.io/etcd/v3/pkg/schedule	0.009s
ok  	go.etcd.io/etcd/v3/pkg/srv	0.019s
ok  	go.etcd.io/etcd/v3/pkg/stringutil	0.008s
?   	go.etcd.io/etcd/v3/pkg/systemd	[no test files]
ok  	go.etcd.io/etcd/v3/pkg/testutil	0.023s
ok  	go.etcd.io/etcd/v3/pkg/tlsutil	3.965s
ok  	go.etcd.io/etcd/v3/pkg/traceutil	0.034s
ok  	go.etcd.io/etcd/v3/pkg/transport	0.532s
ok  	go.etcd.io/etcd/v3/pkg/types	0.028s
ok  	go.etcd.io/etcd/v3/pkg/wait	0.023s
ok  	go.etcd.io/etcd/v3/proxy/grpcproxy	0.101s
?   	go.etcd.io/etcd/v3/proxy/grpcproxy/adapter	[no test files]
?   	go.etcd.io/etcd/v3/proxy/grpcproxy/cache	[no test files]
ok  	go.etcd.io/etcd/v3/proxy/httpproxy	0.044s
ok  	go.etcd.io/etcd/v3/proxy/tcpproxy	0.047s
ok  	go.etcd.io/etcd/v3/raft	0.312s
ok  	go.etcd.io/etcd/v3/raft/confchange	0.183s
ok  	go.etcd.io/etcd/v3/raft/quorum	0.316s
ok  	go.etcd.io/etcd/v3/raft/raftpb	0.024s
ok  	go.etcd.io/etcd/v3/raft/rafttest	0.640s
ok  	go.etcd.io/etcd/v3/raft/tracker	0.026s
ok  	go.etcd.io/etcd/v3/tests/e2e	0.077s
?   	go.etcd.io/etcd/v3/tools/benchmark	[no test files]
?   	go.etcd.io/etcd/v3/tools/benchmark/cmd	[no test files]
?   	go.etcd.io/etcd/v3/tools/etcd-dump-db	[no test files]
ok  	go.etcd.io/etcd/v3/tools/etcd-dump-logs	0.088s
?   	go.etcd.io/etcd/v3/tools/etcd-dump-metrics	[no test files]
?   	go.etcd.io/etcd/v3/tools/local-tester/bridge	[no test files]
?   	go.etcd.io/etcd/v3/version	[no test files]
ok  	go.etcd.io/etcd/v3/wal	1.517s
?   	go.etcd.io/etcd/v3/wal/walpb	[no test files]
go test --short ./... --count=1  76.12s user 12.57s system 375% cpu 23.635 total
```
2020-09-16 13:21:46 +02:00
Piotr Tabor 138a312643 scripts: Removed updatedep.sh.
As we get rid of ./vendor there is no need to update the dependencies.

If anyone needs up-to-date vendor directory locally, getting it is as
simple as:

```go mod vendor```
2020-09-16 13:04:58 +02:00
Jingyi Hu 2aaf4f3d7a
Merge pull request #12278 from ptabor/20200907-fix-cov-integration
integration: Fix 'go test --tags cluster_proxy --timeout=30m -v ./integration/...'
2020-09-16 01:55:09 -07:00
Sahdev Zala 6d07caee50
Merge pull request #12304 from jingyih/update_changelog_12288
CHANGELOG: update from #12288 and #12299
2020-09-15 22:31:01 -04:00
jingyih 37fe4b9afa CHANGELOG: update from 12288 and 12299 2020-09-15 13:25:25 -07:00
Piotr Tabor 872e5a78a3 clientv3/integration: Fix TestLeasingTxtOwnerGet test getting stuck in 'cluster_proxy' mode:
Fixes:
  go test --tags cluster_proxy --timeout=30m -run TestLeasingTxnOwnerGet -v ./clientv3/integration/...

The explicit code to close client is needed due to:
  76e769ce95/clientv3/watch.go (L72)
as just ctx close by LeasingKeyValue store does not interrupts opened Watches.
The only way to interrupt open Watch is to close the 'whole' Watcher / Client.
2020-09-15 18:06:58 +02:00
Jingyi Hu 3752333162
Merge pull request #12288 from galal-hussein/fix_learner_panic_master
etcdserver: add ConfChangeAddLearnerNode to the list of config changes
2020-09-15 08:59:36 -07:00
Piotr Tabor 2048c80760 etcdserver: v3compactor should use proper clock for latency (took) reporting.
The code used to:
  - report time since previous compaction success as a 'duration' of compaction process itself.
  - mix real clock with 'injected' clock. This led to strange log-lines
in tests in order of 234543543h of duration.
2020-09-15 16:43:05 +02:00
Piotr Tabor aa10b1ee7f ./test: Add PASSES="mod_tidy" check
Added check that ensures that go.mod & go.sum files are up-to-date.
The check verifies whether 'go mod tidy' does not generate any mutations
in these files.
The check can be run on its own:
  PASSES="mod_tidy" ./test
Or as part of "fmt" pass:
  PASSES="fmt" ./test

Examplar outputs:

```
% PASSES="fmt" ./test

Running with TEST_CPUS: 1,2,4
Starting 'fmt' pass at Fri 11 Sep 2020 11:07:54 PM CEST
'shellcheck' started at Fri 11 Sep 2020 11:07:54 PM CEST
'shellcheck' completed at Fri 11 Sep 2020 11:07:54 PM CEST
'markdown_you' started at Fri 11 Sep 2020 11:07:54 PM CEST
'markdown_you' completed at Fri 11 Sep 2020 11:07:54 PM CEST
'goword' started at Fri 11 Sep 2020 11:07:54 PM CEST
'goword' completed at Fri 11 Sep 2020 11:07:54 PM CEST
'gofmt' started at Fri 11 Sep 2020 11:07:54 PM CEST
'gofmt' completed at Fri 11 Sep 2020 11:07:55 PM CEST
'govet' started at Fri 11 Sep 2020 11:07:55 PM CEST
'govet' completed at Fri 11 Sep 2020 11:07:57 PM CEST
'revive' started at Fri 11 Sep 2020 11:07:57 PM CEST
Skipping revive...
'revive' completed at Fri 11 Sep 2020 11:07:57 PM CEST
'license_header' started at Fri 11 Sep 2020 11:07:57 PM CEST
'license_header' completed at Fri 11 Sep 2020 11:07:58 PM CEST
'receiver_name' started at Fri 11 Sep 2020 11:07:58 PM CEST
'receiver_name' completed at Fri 11 Sep 2020 11:07:58 PM CEST
'commit_title' started at Fri 11 Sep 2020 11:07:58 PM CEST
'commit_title' completed at Fri 11 Sep 2020 11:07:58 PM CEST
'mod_tidy' started at Fri 11 Sep 2020 11:07:58 PM CEST
*** /tmp/fileiALKRA_go.mod	2020-09-11 23:07:58.838010716 +0200
--- ./go.mod	2020-09-11 23:07:58.974010922 +0200
***************
*** 29,39 ****
  	github.com/mattn/go-runewidth v0.0.2 // indirect
  	github.com/modern-go/reflect2 v1.0.1
  	github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5
  	github.com/prometheus/client_golang v1.0.0
  	github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
- 	github.com/prometheus/common v0.4.1
  	github.com/sirupsen/logrus v1.4.2 // indirect
  	github.com/soheilhy/cmux v0.1.4
  	github.com/spf13/cobra v0.0.3
  	github.com/spf13/pflag v1.0.1
  	github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8
--- 29,38 ----
./go.mod is not in sync with 'go mod tidy'
```

```
% PASSES="mod_tidy" ./test

Running with TEST_CPUS: 1,2,4
Starting 'mod_tidy' pass at Fri 11 Sep 2020 11:09:21 PM CEST
*** /tmp/file9gy4so_go.mod	2020-09-11 23:09:21.166133290 +0200
--- ./go.mod	2020-09-11 23:09:21.286133466 +0200
***************
*** 29,39 ****
  	github.com/mattn/go-runewidth v0.0.2 // indirect
  	github.com/modern-go/reflect2 v1.0.1
  	github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5
  	github.com/prometheus/client_golang v1.0.0
  	github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4
- 	github.com/prometheus/common v0.4.1
  	github.com/sirupsen/logrus v1.4.2 // indirect
  	github.com/soheilhy/cmux v0.1.4
  	github.com/spf13/cobra v0.0.3
  	github.com/spf13/pflag v1.0.1
  	github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8
--- 29,38 ----
./go.mod is not in sync with 'go mod tidy'
```
2020-09-15 14:38:54 +02:00