265 Commits

Author SHA1 Message Date
Benjamin Wang
fdf22b241a add the missing parameter 'name' into SpawnCmdWithLogger for cov test
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-08-29 13:37:23 +08:00
Benjamin Wang
dc4b810195
Merge pull request #14388 from niconorsk/fix/notify-systemd-when-cluster-ready-times-out
etcdmain: Honour ExperimentalWaitClusterReadyTimeout in startEtcd
2022-08-26 18:34:52 +08:00
Nicolai Moore
e15bdd9df1 etcdmain: Honour ExperimentalWaitClusterReadyTimeout in startEtcd
When we can't reach quorum, we were waiting forever and never sending
the systemd notify message. As a result, systemd would eventually time out
and restart the etcd process which likely would make the unhealthy cluster
in an even worse state

Improves #13785

Signed-off-by: Nicolai Moore <niconorsk@gmail.com>
2022-08-26 18:06:50 +10:00
Marek Siarkowicz
70de5c8937 tests: Add context to e2e cluster start
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-08-26 08:08:17 +02:00
Marek Siarkowicz
46fe4b8e1c tests: Rename common client lease methods to match
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-08-26 07:12:47 +02:00
Marek Siarkowicz
b7272df69f tests: Remove dummy client implementations
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-08-26 07:12:47 +02:00
Marek Siarkowicz
72bec6fbc2 tests: Add context to common client interface
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-08-26 07:12:45 +02:00
Benjamin Wang
e40828540c
Merge pull request #14354 from biosvs/add-client-auto-sync-to-proxy
Added client-auto-sync-interval argument to the grpc-proxy
2022-08-26 05:36:01 +08:00
Vitalii Levitskii
be58a2539c Added client-auto-sync-interval argument to the grpc-proxy
Signed-off-by: Vitalii Levitskii <vitalii@uber.com>
2022-08-25 15:33:38 +03:00
Marek Siarkowicz
f36a8782f0
Merge pull request #14345 from nic-chen/tests/watch
tests: Migrate watch test to common framework
2022-08-25 13:35:34 +02:00
Benjamin Wang
82bf79d4ce
Merge pull request #14376 from biosvs/fix-expect-package
Fixed infinite loop in ExpectProcess.ExpectFunc
2022-08-25 05:29:30 +08:00
Vitalii Levitskii
71c5360f98 Fixed infinite loop in ExpectProcess.ExpectFunc
Signed-off-by: Vitalii Levitskii <vitalii@uber.com>
2022-08-24 16:46:24 +03:00
nic-chen
f6ed36372b tests: Migrate watch test to common framework
Signed-off-by: nic-chen <chenjunxu6@gmail.com>
2022-08-22 21:55:57 +08:00
Sahdev Zala
192d635da9
Merge pull request #14292 from tjungblu/debug_e2e
Add test name to e2e cluster members
2022-08-20 19:30:44 -04:00
Clark
0b9f43410a tests: e2e and integration share TickDuration constant
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-08-14 18:49:46 +08:00
Clark
a5409c62e6 tests: add WaitLeader function to common framework
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-08-11 12:46:40 +08:00
Clark
7fa88fb8f7 tests: fix status responses size and nil
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-08-03 03:10:45 +08:00
Thomas Jungblut
51933a7c8b Add test name to e2e cluster members
This should aid in debugging test flakes, especially in tests where the process is restarted very often and thus changes its pid.
Now it's a lot easier to grep for different members, also when different tests fail at the same time.
The test TestDowngradeUpgradeClusterOf3 as mentioned in #13167 is a good example for that.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2022-08-01 15:57:16 +02:00
Clark
13d20f8d28 tests: Migrate member list tests to common framework
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-07-26 23:28:19 +08:00
Marek Siarkowicz
d44bbff278 server: Make corrtuption check optional and period configurable
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-07-26 09:31:15 +02:00
Marek Siarkowicz
f0f750f4c0 tests: Cover periodic check in tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-07-25 13:59:31 +02:00
Benjamin Wang
f40b676701 add e2e test cases to cover the maxConcurrentStreams
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-07-06 03:43:46 +08:00
Benjamin Wang
ae9ca48a3f remove duplicate certificate configuration for proxy test
The issue was introduced in the following commit,
093282f5ea

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-06-30 10:26:36 +08:00
Piotr Tabor
651de5a057 Rename EtcdServer.Id with EtcdServer.MemberId.
It was misleading and error prone vs. ClusterId.
2022-05-20 14:32:04 +02:00
Marek Siarkowicz
ee08770bfb tests: Make common framework context aware 2022-05-16 14:35:44 +02:00
Benjamin Wang
29f090b5c0
Merge pull request #14029 from serathius/spawn-json-command
tests: Refactor spawn json command
2022-05-14 05:06:03 +08:00
Marek Siarkowicz
83a4309f3b tests: Refactor spawn json command 2022-05-13 15:04:45 +02:00
ahrtr
1e6163ba27 remove v2 http proxy in 3.6 2022-05-13 17:44:58 +08:00
Vimal Kumar
55f0c96fa0 tests: Migrate Txn tests to common functional test framework 2022-05-11 10:33:47 +05:30
Marek Siarkowicz
066e510731
Merge pull request #14020 from chaochn47/role_test
migrate e2e & integration role_test to common
2022-05-10 23:39:14 +02:00
Chao Chen
e004c91d36 migrate e2e & integration role_test to common 2022-05-10 10:17:16 -07:00
Marek Siarkowicz
e292e5b0b4 tests: Apply suggestions from code-review 2022-05-06 12:09:44 +02:00
Marek Siarkowicz
a65f7da5cb server: Implement HA downgrade test 2022-05-06 12:09:44 +02:00
Marek Siarkowicz
75449c075d tests: Allow sepecting member to in curl commands 2022-05-06 12:09:43 +02:00
Marek Siarkowicz
26f42e7a9e server: Apply review comments and split basic handler 2022-05-05 09:52:14 +02:00
Marek Siarkowicz
722ec487df server: Split metrics and health code 2022-05-05 09:52:14 +02:00
Marek Siarkowicz
600ee13ac0 server: Cover V3 health with tests 2022-05-05 09:52:14 +02:00
Marek Siarkowicz
0096d2ecdb server: Remove unused NewClientHandler 2022-05-05 09:52:13 +02:00
ahrtr
24002fb099 allocate unique port for each member in test cases 2022-04-26 12:32:00 +08:00
Piotr Tabor
d69e07dd3a Verification framework and check whether cindex is not decreasing. 2022-04-22 12:32:05 +02:00
ahrtr
fe3a57976e support linearizable renew lease
When etcdserver receives a LeaseRenew request, it may be still in
progress of processing the LeaseGrantRequest on exact the same
leaseID. Accordingly it may return a TTL=0 to client due to the
leaseID not found error. So the leader should wait for the appliedID
to be available before processing client requests.
2022-04-10 14:44:55 +08:00
Marek Siarkowicz
05e6527d26
Merge pull request #13756 from serathius/test-snapshot
tests: Add tests for snapshot compatibility and recovery between versions
2022-04-08 14:14:19 +02:00
Danielle Lancashire
7cc00ec981 tests/framework/integration: Fail nesting early
Currently there are a handful of tests within etcd that silently fail
because LeakDetection will skip the test before it manages to hit this
check.

Here we move the check to the beginning of the process to highlight
these cases earlier, and to avoid them accidentally presenting as leaks.
2022-04-07 13:10:15 +00:00
Marek Siarkowicz
3ffa253516 tests: Add tests for snapshot compatibility and recovery between versions 2022-04-06 16:10:38 +02:00
Marek Siarkowicz
c4d055fe7b
Merge pull request #13819 from endocrimes/dani/auth_test.go
migrate e2e/users tests to common framework
2022-04-06 16:02:46 +02:00
Piotr Tabor
68f2cb8c77 Fix ExampleAuth from integration/clientv3/examples (on OsX)
The code now ensures that each of the test is running in its own directory as opposed to shared os.tempdir.
```
$  (cd tests && env go test -timeout=15m --race go.etcd.io/etcd/tests/v3/integration/clientv3/examples -run ExampleAuth)
2022/04/03 10:24:59 Running tests (examples): ...
2022/04/03 10:24:59 the function can be called only in the test context. Was integration.BeforeTest() called ?
2022/04/03 10:24:59 2022-04-03T10:24:59.462+0200	INFO	m0	LISTEN GRPC	{"member": "m0", "grpcAddr": "localhost:m0", "m.Name": "m0"}
```
2022-04-03 14:16:45 +02:00
Piotr Tabor
d57f8dba62 Deflaking: Make WaitLeader (and WaitMembersForLeader) aggressively (30s) wait for leader being established.
Nearly none of the tests was checking the value... just assuming WaitLeader success.

```
    maintenance_test.go:277: Waiting for leader...
    logger.go:130: 2022-04-03T08:01:09.914+0200	INFO	m0	cluster version differs from storage version.	{"member": "m0", "cluster-version": "3.6.0", "storage-version": "3.5.0"}
    logger.go:130: 2022-04-03T08:01:09.915+0200	WARN	m0	leader failed to send out heartbeat on time; took too long, leader is overloaded likely from slow disk	{"member": "m0", "to": "2acc3d3b521981", "heartbeat-interval": "10ms", "expected-duration": "20ms", "exceeded-duration": "103.756219ms"}
    logger.go:130: 2022-04-03T08:01:09.916+0200	INFO	m0	updated storage version	{"member": "m0", "new-storage-version": "3.6.0"}
    ...
    logger.go:130: 2022-04-03T08:01:09.926+0200	INFO	grpc	[[roundrobin] roundrobinPicker: Build called with info: {map[0xc002630ac0:{{unix:localhost:m0 localhost <nil> 0 <nil>}} 0xc002630af0:{{unix:localhost:m1 localhost <nil> 0 <nil>}} 0xc002630b20:{{unix:localhost:m2 localhost <nil> 0 <nil>}}]}]
    logger.go:130: 2022-04-03T08:01:09.926+0200	WARN	m0	apply request took too long	{"member": "m0", "took": "114.661766ms", "expected-duration": "100ms", "prefix": "", "request": "header:<ID:12658633312866157316 > cluster_version_set:<ver:\"3.6.0\" > ", "response": ""}
    logger.go:130: 2022-04-03T08:01:09.927+0200	INFO	m0	cluster version is updated	{"member": "m0", "cluster-version": "3.6"}
    logger.go:130: 2022-04-03T08:01:09.955+0200	INFO	m2.raft	9f96af25a04e2ec3 [logterm: 2, index: 8, vote: 9903a56eaf96afac] ignored MsgVote from 2acc3d3b521981 [logterm: 2, index: 8] at term 2: lease is not expired (remaining ticks: 10)	{"member": "m2"}
    logger.go:130: 2022-04-03T08:01:09.955+0200	INFO	m0.raft	9903a56eaf96afac [logterm: 2, index: 8, vote: 9903a56eaf96afac] ignored MsgVote from 2acc3d3b521981 [logterm: 2, index: 8] at term 2: lease is not expired (remaining ticks: 5)	{"member": "m0"}
    logger.go:130: 2022-04-03T08:01:09.955+0200	INFO	m0.raft	9903a56eaf96afac [term: 2] received a MsgAppResp message with higher term from 2acc3d3b521981 [term: 3]	{"member": "m0"}
    logger.go:130: 2022-04-03T08:01:09.955+0200	INFO	m0.raft	9903a56eaf96afac became follower at term 3	{"member": "m0"}
    logger.go:130: 2022-04-03T08:01:09.955+0200	INFO	m0.raft	raft.node: 9903a56eaf96afac lost leader 9903a56eaf96afac at term 3	{"member": "m0"}
    maintenance_test.go:279: Leader established.
```

Tmp
2022-04-03 12:23:09 +02:00
Piotr Tabor
2fab3f3ae5 Make naming of test-nodes consistent and positive: m0, m1, m2
The nodes used to be named: m-1, m0, m1, that was generating very confusing logs
in integration tests.
2022-04-03 09:16:55 +02:00
Piotr Tabor
f85cd0296f
Merge pull request #13872 from ptabor/20220402-osx-unit-test-pass
Fix TestauthTokenBundleOnOverwrite on OsX:
2022-04-02 20:03:38 +02:00
Piotr Tabor
3b589fb3b2 Fix TestauthTokenBundleOnOverwrite on OsX:
```
% (cd client/v3 && env go test -short -timeout=3m --race ./...)
--- FAIL: TestAuthTokenBundleNoOverwrite (0.00s)
    client_test.go:210: listen unix /var/folders/t1/3m8z9xz93t9c3vpt7zyzjm6w00374n/T/TestAuthTokenBundleNoOverwrite3197524989/001/etcd-auth-test:0: bind: invalid argument
FAIL
FAIL	go.etcd.io/etcd/client/v3	4.270s
```

The reason was that the path exceeded 108 chars (that is too much for socket).
In the mitigation we first change chroot (working directory) to the tempDir... such the path is 'local'.
2022-04-02 16:12:02 +02:00