133 Commits

Author SHA1 Message Date
Marek Siarkowicz
39d98522d6 tests: Enable progress notify in linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-09 07:32:54 +08:00
Wei Fu
fa527c5e54 tests: support to stop the multiple members concurrently
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-02-03 22:23:06 +08:00
Marek Siarkowicz
2fcb05710d tests: Move stopping proxy to after process stop to speed up cluster shutdown
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-12 15:17:34 +01:00
Marek Siarkowicz
deb4291485 tests: Trigger only failpoints available in binary
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-09 17:29:38 +01:00
Marek Siarkowicz
acf3782c20
Merge pull request #15048 from serathius/linearizability-network
tests: Implement network delay and blackholing in linearizability tests
2023-01-09 14:51:54 +01:00
Marek Siarkowicz
064fad5ae4 tests: Implement network delay and blackholing in linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-09 14:18:07 +01:00
Chao Chen
2c46b2b299 externalize snapshot catchup entries to etcd flag
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-01-04 19:01:07 -08:00
Wei Fu
4d0b91947e chore: delete // +build buildtag by go fix
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-12-29 14:17:05 +08:00
Wei Fu
a438794abb e2e: deflake TestCtlV3AuthGracefulDisable
We should call Wait for grpc-proxy process stop before start. Otherwise,
the tcp port won't be released.

Fixes: #14926

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-12-16 13:33:02 +08:00
Marek Siarkowicz
738ee3687a tests: Allow failpoint requests to fail assuming that process exists within 1 second
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 09:08:36 +01:00
Clark
b298c85a34 tests: fix anti-pattern name in NewEtcdProcessCluster
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-11-23 00:32:10 +08:00
Benjamin Wang
ebfcaaed34 test: fix the test failures in e2e/warning_logging_test.go
1. Fixed the test failures which are caused by recent test framework rafactoring;
2. renamed the file to promote_experimental_flag_test.go.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-19 01:51:06 +08:00
Bogdan Kanivets
7e8ebf7727 server: added duplicate warning-unary-request-duration flag
--warning-unary-request-duration is a duplicate of --experimental-warning-unary-request-duration
experimental-warning-unary-request-duration will be removed in v3.7.

fixes https://github.com/etcd-io/etcd/issues/13783

Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
2022-11-18 18:06:00 +08:00
Marek Siarkowicz
371179e292 tests: Trigger raftBeforeLeaderSend
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-17 14:17:16 +01:00
Marek Siarkowicz
bf3eea8831 tests: Allow creating client for EtcdProcess
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-17 10:48:14 +01:00
Clark
7180267d56 tests: refactor EtcdProcessClusterConfig with Functional Options Pattern
remove `cfg *EtcdProcessClusterConfig` param from `NewEtcdProcessCluster` function

Signed-off-by: Clark <fwyongxing@gmail.com>
2022-11-16 15:05:29 +08:00
Clark
9406de0033 tests: refactor EtcdProcessClusterConfig with Functional Options Pattern
replace all initialisations with `DefaultConfig`, `NewConfig` and `EPClusterOption`

Signed-off-by: Clark <fwyongxing@gmail.com>
2022-11-16 15:05:28 +08:00
Marek Siarkowicz
8ae4420c4c tests: Add compact failpoints
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-15 15:00:18 +01:00
Marek Siarkowicz
f8162919f9
Merge pull request #14744 from clarkfw/functional-options-pattern-EtcdProcessClusterConfig-2-1
tests: refactor `EtcdProcessClusterConfig` using Functional Options Pattern
2022-11-15 09:27:24 +01:00
Thomas Jungblut
5b163aa507 Expect exit code enhancement
ExpectProcess and ExpectFunc now take the exit code of the process into
account, not just the matching of the tty output.

This also refactors the many tests that were previously succeeding on
matching an output from a failing cmd execution.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2022-11-14 11:19:41 +01:00
Clark
3510680c32 tests: refactor EtcdProcessClusterConfig using Functional Options Pattern
replace some initialisations with `DefaultConfig`, `NewConfig` and `EPClusterOption`

Signed-off-by: Clark <fwyongxing@gmail.com>
2022-11-14 03:07:51 +08:00
Clark
caaeee2920 tests: refactor EtcdProcessClusterConfig with Functional Options Pattern
replace some initialisations with `DefaultConfig`, `NewConfig` and `EPClusterOption`

Signed-off-by: Clark <fwyongxing@gmail.com>
2022-11-13 00:27:41 +08:00
Benjamin Wang
dbc7204610 test: Create a subdirectory for each member when DataDirPath is specified
When e2e test cases specify the DataDirPath and there are more than
one member in the cluster, we need to create a subdirectory for each
member. Otherwise all members share the same directory and accordingly
lead to conflict.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-11 18:48:42 +08:00
Benjamin Wang
080effc935 test: enhance StartNewProc to accept one more parameter: EtcdProcessClusterConfig
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-09 16:04:22 +08:00
Clark
269a0beb41 tests: refactor EtcdProcessClusterConfig with Functional Options Pattern
add `DefaultConfig`, `NewConfig` and `EPClusterOption`

Signed-off-by: Clark <fwyongxing@gmail.com>
2022-11-09 03:37:42 +08:00
Benjamin Wang
fc23d0e83a test: add ClusterContext into the common ClusterConfig
ClusterContext is used by "e2e" or "integration" to extend the
ClusterConfig. The common test cases shouldn't care about what
data is encoded or included; instead "e2e" or "integration"
framework should decode or parse it separately.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-07 10:05:45 +08:00
Marek Siarkowicz
71b40b3abf tests: Extend common test to run previous release
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-07 06:51:59 +08:00
Benjamin Wang
d71762f4f0
Merge pull request #14683 from ahrtr/test_framework_20221104
test: refactor the framework structure to make it clearer
2022-11-05 04:30:59 +08:00
Benjamin Wang
dc0273b049 test: refactor the struct to make it clearer
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-04 19:28:32 +08:00
Marek Siarkowicz
e614eec948
Merge pull request #14560 from serathius/env
tests: Pass only etcd related environment variables during e2e tests
2022-11-04 11:24:07 +01:00
Wei Fu
3ddcb3ddef test: deflake TestDowngradeUpgradeClusterOf3 timeout
In the TestDowngradeUpgradeCluster case, the brand-new cluster is using
simple-config-changer, which means that entries has been committed
before leader election and these entries will be applied when etcdserver
starts to receive apply-requests. The simple-config-changer will mark
the `confState` dirty and the storage backend precommit hook will update
the `confState`.

For the new cluster, the storage version is nil at the beginning. And
it will be v3.5 if the `confState` record has been committed. And it
will be >v3.5 if the `storageVersion` record has been committed.

When the new cluster is ready, the leader will set init cluster version
with v3.6.x. And then it will trigger the `monitorStorageVersion` to
update the `storageVersion` to v3.6.x. If the `confState` record has
been updated before cluster version update, we will get storageVersion
record.

If the storage backend doesn't commit in time, the
`monitorStorageVersion` won't update the version because of `cannot
detect storage schema version: missing confstate information`.

And then we file the downgrade request before next round of
`monitorStorageVersion`(per 4 second), the cluster version will be
v3.5.0 which is equal to the `UnsafeDetectSchemaVersion`'s result.
And we won't see that `The server is ready to downgrade`.

It is easy to reproduce the issue if you use cpuset or taskset to limit
in two cpus.

So, we should wait for the new cluster's storage ready before downgrade
request.

Fixes: #14540

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-11-02 22:50:31 +08:00
Oleg Guba
b22e3ff4eb Allow passing client options to Client()
Signed-off-by: Oleg Guba <oleg@dropbox.com>
2022-10-27 14:08:23 -07:00
Oleg Guba
47c558e605 [e2e] don't pass --endpoints flag in test HashKV implementation
Signed-off-by: Oleg Guba <oleg@dropbox.com>
2022-10-27 02:02:58 -07:00
Chao Chen
f3c47d760c update auth test interface
Signed-off-by: Chao Chen <chaochn@amazon.com>
2022-10-26 09:56:22 -04:00
Marek Siarkowicz
8ce81a1624
Merge pull request #14611 from serathius/issue14370
tests: Add linearizability tests scenario for #14370
2022-10-25 14:03:39 +02:00
Marek Siarkowicz
837819860b tests: Add linearizability tests scenario for #14370
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-24 13:36:12 +02:00
Benjamin Wang
4e0ccc69c9 test: refactor the client interface
It doesn't make sense to always pass a AuthConfig parameter for
test cases which do not enable auth at all. So refactoring the
Client interface method so that it accepts a `ClientOption`
variadic parameter.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-24 19:04:34 +08:00
Marek Siarkowicz
e5790d204c
Merge pull request #14398 from serathius/linearizability
Validate etcd linearizability
2022-10-23 12:09:30 +02:00
Marek Siarkowicz
069e26e284 tests: Validate etcd linearizability
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-23 06:41:38 +02:00
Benjamin Wang
3b4c255444
Merge pull request #14608 from veshij/auth
[e2e] Fix AuthEnable/Disable e2e test implementations
2022-10-22 08:19:05 +08:00
Oleg Guba
44bc007494 Update tests/framework/e2e/etcdctl.go
address comment

Co-authored-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Oleg Guba <oleg@dropbox.com>
2022-10-21 10:44:09 -07:00
Oleg Guba
24831a0242 Update tests/framework/e2e/etcdctl.go
address comment

Co-authored-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Oleg Guba <oleg@dropbox.com>
2022-10-21 10:44:09 -07:00
Oleg Guba
a39374f33a [e2e] Fix AuthEnable/Disable e2e test implementations
Signed-off-by: Oleg Guba <oleg@dropbox.com>
2022-10-20 19:15:31 -04:00
Benjamin Wang
b5751636e3
Merge pull request #14607 from veshij/hashkv
[e2e] Fix bug in EtcdctlV3.HashKV() e2e implementation.
2022-10-21 06:02:01 +08:00
Oleg Guba
a466d5cc2e [e2e] Fix bug in EtcdctlV3.HashKV()
Signed-off-by: Oleg Guba <oleg@dropbox.com>
2022-10-20 17:37:16 -04:00
Marek Siarkowicz
1b3f301cc2 tests: Share SpawnCmdWithLogger between coverage and no coverage scenarios
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-17 14:10:11 +02:00
Marek Siarkowicz
574b3d33d1 test: Remove BinDir global variable
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-17 14:09:51 +02:00
Marek Siarkowicz
9bba38e51f tests: Include etcd-last-release in BinPath
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-17 14:09:51 +02:00
Marek Siarkowicz
89a1e7978c tests: Configure coverage binary paths via init
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-17 14:09:51 +02:00
Marek Siarkowicz
d3b9951126 tests: Refactor BinPath into struct
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-17 14:09:49 +02:00