1488 Commits

Author SHA1 Message Date
James Blair
870d478844
Merge e2e spawn files.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-30 22:38:00 +13:00
Marek Siarkowicz
4340cbb4aa
Merge pull request #15575 from serathius/ensure-watch
tests: Ensure watch catches all events generated in traffic
2023-03-30 10:28:22 +02:00
Marek Siarkowicz
65add8cec4 tests: Test separate http port connection multiplexing
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-30 09:49:45 +02:00
Marek Siarkowicz
bf12179a5a server: Add --listen-client-http-urls flag to allow running grpc server separate from http server
Difference in load configuration for watch delay tests show how huge the
impact is. Even with random write scheduler grpc under http
server can only handle 500 KB with 2 seconds delay. On the other hand,
separate grpc server easily hits 10, 100 or even 1000 MB within 100 miliseconds.

Priority write scheduler that was used in most previous releases
is far worse than random one.

Tests configured to only 5 MB to avoid flakes and taking too long to fill
etcd.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-30 09:49:45 +02:00
James Blair
5faad23812
Merge branch 'main' into remove_e2e_calc 2023-03-30 16:46:31 +13:00
James Blair
4b87bb1852
Remove coverage implementation for ctl_v3_watch test.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-30 15:44:17 +13:00
James Blair
3c40a68d09
Remove nocov flags for e2e tests.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-30 15:37:09 +13:00
James Blair
1b125300bb
Remove nocov implementation for e2e spawn.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-30 15:17:53 +13:00
Marek Siarkowicz
ad688b2a85 tests: Ensure watch catches all events generated in traffic
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-29 11:41:10 +02:00
Marek Siarkowicz
245ef029d5
Merge pull request #15319 from serathius/linearizability-watch-validation-refactor
tests: Refactor watch validation
2023-03-29 09:24:32 +02:00
Benjamin Wang
4ecb801846
Merge pull request #15578 from chaochn47/auth_test_split_7
migrate auth tests to common #7
2023-03-29 07:07:21 +08:00
Marek Siarkowicz
c54521156e tests: Refactor watch validation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-28 17:32:34 +02:00
Marek Siarkowicz
5223d09d41
Merge pull request #14838 from serathius/linearizability-docs
tests: Document robustness tests
2023-03-28 16:22:09 +02:00
Marek Siarkowicz
d03ac88b36 tests: Document robustness tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-28 15:08:43 +02:00
Chao Chen
9a2553fe2f migrate auth tests to common #7
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-27 19:30:41 -07:00
Benjamin Wang
8c4bbcc8c7 dependency: bump golang.org/x/ to 0.7.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-21 08:36:39 +08:00
Marek Siarkowicz
3e5fc2e4fc tests: Enable BlackholeUntilSnapshot robustness scenario
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-20 11:15:42 +01:00
Wei Fu
a9988e2625 server/embed: fix data race when start insecure grpc
There are two goroutines accessing the `gs` grpc server var. Before
insecure `gs` server start, the `gs` can be changed to secure server and
then the client will fail to connect to etcd with insecure request. It
is data-race. We should use argument for reference in the new goroutine.

fix: #15495

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-18 21:48:58 +08:00
Benjamin Wang
f9bdd8c96c
Merge pull request #15502 from chaochn47/deflake_TestMemberList
deflake member_test: enable pre-vote by default and add retry
2023-03-18 07:55:02 +08:00
Benjamin Wang
6cfe4bcf1f
Merge pull request #15501 from chaochn47/defake_TestTracing
deflake TestTracing
2023-03-18 07:24:02 +08:00
Chao Chen
d7f992c351 enable pre-vote by default and add retry on member_test
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-17 15:15:13 -07:00
Chao Chen
f163af2bc8 deflake TestTracing
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-17 14:39:18 -07:00
Marek Siarkowicz
dfc2c6d44b tests: Add connection muiltiplexer testing
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-15 15:56:39 +01:00
Marek Siarkowicz
aad24ebe2a tests: Extract e2e test utils
Consider creating generic testutils for both e2e and integration tests.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-15 14:47:49 +01:00
Marek Siarkowicz
cbf819740e tests: Allow specifying http version in curl
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-15 09:27:51 +01:00
Marek Siarkowicz
ae30e5c2fb tests: Refactor newClient args
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-15 09:27:51 +01:00
Marek Siarkowicz
e87abf3f13 tests: Refactor CURLPrefixArgs
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-14 16:35:43 +01:00
Marek Siarkowicz
67e3c784ba tests: Remove MetricsURLScheme field
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-14 16:35:43 +01:00
Benjamin Wang
7f37b3630f
Merge pull request #15453 from serathius/refactor-url-names
Refactor url names
2023-03-14 08:09:49 +08:00
Benjamin Wang
a141585b1c test: fix format error
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-14 05:53:53 +08:00
Marek Siarkowicz
372042c374 refactor: Use proper variable names for urls
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-13 14:48:01 +01:00
Wei Fu
4a9ad47bcc tests/integration: deflake #15409
The cluster version will be initialized after the member becomes leader.
The update is handled asynchronously. It couldn't be updated if the member
has been closed and the go-runtime picks the `s.stopping` channel first.

```go
// e2a5df534c/server/etcdserver/server.go (L2170)

func (s *EtcdServer) monitorClusterVersions() {
	...
	for {
		select {
		case <-s.firstCommitInTerm.Receive():
		case <-time.After(monitorVersionInterval):
		case <-s.stopping:
			return
		}
		...
	}
}
```

Or after the `s.stopping` has been closed, the [UpdateClusterVersion][1] won't
file GoAttach successfully. For the #15409, we can see the warn log
`server has stopped; skipping GoAttach` from GoAttach:

```plain
https://github.com/etcd-io/etcd/actions/runs/4340931587/jobs/7580103902

    logger.go:130: 2023-03-06T07:36:44.253Z	WARN	default	stopping grpc server due to error	{"error": "accept tcp 127.0.0.1:2379: use of closed network connection"}
    logger.go:130: 2023-03-06T07:36:44.253Z	WARN	default	stopped grpc server due to error	{"error": "accept tcp 127.0.0.1:2379: use of closed network connection"}
    logger.go:130: 2023-03-06T07:36:44.253Z	ERROR	default	setting up serving from embedded etcd failed.	{"error": "accept tcp 127.0.0.1:2379: use of closed network connection"}
    logger.go:130: 2023-03-06T07:36:44.253Z	ERROR	default	setting up serving from embedded etcd failed.	{"error": "http: Server closed"}
    logger.go:130: 2023-03-06T07:36:44.253Z	INFO	default	skipped leadership transfer for single voting member cluster	{"local-member-id": "8e9e05c52164694d", "current-leader-member-id": "8e9e05c52164694d"}

    logger.go:130: 2023-03-06T07:36:44.253Z	WARN	default	server has stopped; skipping GoAttach

    ...
```

If the cluster version isn't updated, the minimum storage version will
be v3.5 because the [AuthStatus][2] is introduced in [v3.5][3].
The compare will fail.

To fix this issue, we should wait for cluster version to become ready
after server is ready to serve request.

[1]: <e2a5df534c/server/etcdserver/adapters.go (L45)>
[2]: <071e70cdc4>
[3]: <1b4e54c238>

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-11 14:50:37 +08:00
Marek Siarkowicz
659c74e60e
Merge pull request #15431 from serathius/watch-random-scheduler
Watch random scheduler
2023-03-10 13:29:54 +01:00
Marek Siarkowicz
585dfe0186 test: Test etcd watch stream starvation under high read response load when sharing the same connection
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-10 12:42:33 +01:00
Marek Siarkowicz
b3bb996880
Merge pull request #15420 from ahrtr/dependency_20230307
Bump some dependencies
2023-03-09 13:03:56 +01:00
James Blair
5b3497555f
Updated go to 1.19.7.
Mitigates CVE-2023-24532.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-08 21:39:31 +13:00
Wei Fu
3419230eea tests/integration: Update TestLeasingDeleteRangeContendTxn
The TestLeasingDeleteRangeContendTxn is trying to test for RangeDelete when
the target resources are being updated.  When the `txnLeasing` wants a
server-side transaction, it needs to ensure all the keys mod revision should
be leass than what it saw. If the compare fails, it will repeat to apply the
server-side transaction until it is sucessful. I believe the test-case is
trying to verify how the `txnLeasing` handles the race issue.

Before the patch #15401, the resource-updating goroutine keeps updating until
the RangeDelete finishes. The testcase is flaky because two goroutines are
sharing one `ctx` and grpc-go client won't wait for the response if `ctx`
has been canceled.

For example,

| DelLease Goroutine   | PutLease Goroutine         | ETCD Server                    | Key/0 Status |
| --                   | ---                        | --                             | --           |
| deleted              |                            |                                | version = 0  |
|                      | send update(key/0=123) req | received update(key/0=123) req | version = 0  |
| cancel               |                            |                                | version = 0  |
|                      | exit because of cancel     |                                | version = 0  |
| get key/0 by putkv   |                            |                                | version = 0  |
|                      |                            | applied update(key/0=123)      | version = 1  |
| get key/0 by raw-cli |                            |                                | version = 1  |

So `raw-cli` gets `[key/0=123]` while the `putkv` gets `[]`. If `putkv`
applies two update reqs to ETCD server and the last one is canceled
before apply, the error will be like:

```
expected [key:"key/0" version:2 value:"123" ], got [key:"key/0" version:1 value:"123" ]
```

The resource-updating goroutine should not share the ctx with RangeDelete here.
And I also revert current main branch because the resource-update goroutine
only updates 8 times and might exit before `RangeDelete`. In this case,
the `txnLeasing` is not handling the race issue.

Fixes: #15352

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-07 23:11:41 +08:00
Benjamin Wang
7ed1219861 dependency: bump golang.org/x/net to v0.8.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-07 06:52:07 +08:00
Benjamin Wang
b53d63219a dependency: bump github.com/cheggaaa/pb/v3 to v3.1.2
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-07 06:17:01 +08:00
James Blair
275e10bcf7
Return default snapshot count to 10,000.
The huge (100k+) value was justified when storev2 was being dumped completely with every snapshot.

With storev2 being decomissioned we can checkpoint more frequently for faster recovery.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-06 20:21:03 +13:00
Chao Chen
c002e096b5 migration auth tests to common #5
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-03 12:26:36 -08:00
Marek Siarkowicz
85bd9d7719
Merge pull request #15401 from tjungblu/racefix_15352
Fixing flaky TestLeasingDeleteRangeContendTxn
2023-03-03 12:23:25 +01:00
Thomas Jungblut
63964ec781 Fixing flaky TestLeasingDeleteRangeContendTxn
Fixes etcd-io#15352.
Depending on the goroutine scheduling, the expected count of 8 might not
have been reached yet. This ensures the routine won't stop earlier than
that.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2023-03-03 11:38:22 +01:00
Piotr Tabor
d358e35f3e
Merge pull request #15379 from chaochn47/auth_test_split_6
migrate auth tests to common #6
2023-03-03 10:55:28 +01:00
Benjamin Wang
56423eacd2 dependency: bump go.opentelemetry.io/otel to v1.14.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-03 15:44:47 +08:00
Chao Chen
d798816baf migrate auth tests to common #6
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-02-28 10:32:29 -08:00
Benjamin Wang
5f872589cd dependency: bump golang.org/x/sync to v0.1.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-28 06:56:16 +08:00
Benjamin Wang
6af2c9dbfa dependency: bump golang.org/x/crypto to v0.6.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-28 06:51:55 +08:00
Benjamin Wang
f333148da9 dependency: bump golang.org/x/time to v0.3.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-28 06:49:39 +08:00
Benjamin Wang
d8b8127084 dependency: bump github.com/stretchr/testify from 1.8.1 to 1.8.2
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-28 06:44:33 +08:00