37 Commits

Author SHA1 Message Date
Marek Siarkowicz
5a54fe6dd1
Merge pull request #16457 from serathius/downgrade-membership
Add membership changes to downgrade tests
2023-08-22 12:14:40 +02:00
Benjamin Wang
30b5c37190 test: verify snap.Load() is sucessful
Otherwise the following snap.Data may run into nil pointer panic.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-08-22 10:08:34 +01:00
Marek Siarkowicz
1c0db872d9 Add membership changes to downgrade tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-08-22 10:18:30 +02:00
Geeta Gharpure
b0887354e9 Update etcdutl restore to create v2 snapshot from v3
Signed-off-by: Geeta Gharpure <geetagh@amazon.com>
2023-08-11 21:47:34 +00:00
Geeta Gharpure
06350aba43 Update downgrade test to use snapshot
Signed-off-by: Geeta Gharpure <geetagh@amazon.com>
2023-06-13 17:23:49 +00:00
Marek Siarkowicz
b80fb0a1ce tests/e2e: Use epc.Etcdctl
Signed-off-by: Marek Siarkowicz <serathius@users.noreply.github.com>
2023-06-09 20:39:57 +02:00
Marek Siarkowicz
0cbd56e8b6 tests: Cleanup endpoints
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-04-03 12:18:54 +02:00
Marek Siarkowicz
029315f57e tests/robustness: Support running snapshot tests on older versions
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-04-03 10:43:06 +02:00
Marek Siarkowicz
e87abf3f13 tests: Refactor CURLPrefixArgs
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-14 16:35:43 +01:00
Piotr Tabor
9abc895122 Goimports: Apply automated fixing to test files as well.
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-29 13:04:45 +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
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
Thomas Jungblut
0daf153b4f Take binary version in Downgrade/Upgrade Test
This fix avoids the assumption of knowing the current version of the
binary. We can query the binary with the version flag to get the actual
version of the given binary we upgrade and downgrade to. The
respectively reported versions should match what is returned by the
version endpoint.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2022-11-09 10:41:07 +01: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
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
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
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
0f9e15fc37 test: Remove accessing etcd via BinDir
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-17 14:09:51 +02:00
Piotr Tabor
de41f83343
Merge pull request #14383 from serathius/context-e2e
tests: Add context to e2e cluster start
2022-08-29 21:12:12 +02: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
72bec6fbc2 tests: Add context to common client interface
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-08-26 07:12:45 +02: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
c50fbb9ad6 tests: Retry validating version during downgrades 2022-05-06 12:09:44 +02:00
Marek Siarkowicz
c9af75dd8d tests: Improve logging in downgrade tests 2022-05-06 12:09:43 +02:00
Marek Siarkowicz
7b04674d17 server: Move fatal calls out of internal function to make stacktrace cleaner 2022-05-06 12:09:43 +02:00
Marek Siarkowicz
75449c075d tests: Allow sepecting member to in curl commands 2022-05-06 12:09:43 +02:00
Marek Siarkowicz
923096a2bb tests: Simplify downgrade tests 2022-05-06 12:09:43 +02:00
Marek Siarkowicz
3f05f7de92 tests: Use restart in downgrade tests 2022-05-06 12:09:43 +02:00
Marek Siarkowicz
744dd077cd tests: Create common framework for e2e and integration tests and migrate TestKVPut test 2022-02-23 16:47:02 +01:00
Marek Siarkowicz
2a7766c8cd tests: Switch downgradetests to use etcdctl 2022-02-21 17:58:19 +01:00
Marek Siarkowicz
a0f26ff4ea server: Snapshot after cluster version downgrade 2022-02-21 15:48:00 +01:00
Marek Siarkowicz
3de5e221a8 tests: Fix cluster version and downgrade request timeout
Returning nil means that raft.Trigger was not called, causing member to
wait infinitly for response for response on raft request.
2022-02-14 14:19:06 +01:00
Marek Siarkowicz
6c2be0822d tests: Add e2e tests for downgrades 2021-10-29 12:47:19 +02:00