Commit Graph

1260 Commits (a6ab774458411a6c0ea08f5df97e4dcc9a836345)

Author SHA1 Message Date
Marek Siarkowicz b4f9bb45fc tests: Allow multiple operations with same mod revisions, but forbid those operations to be spread between multiple responses
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-14 14:36:51 +01:00
Marek Siarkowicz 6c439aa9e2
Merge pull request #15283 from serathius/linearizability-blackhole-refactor
tests: Refactor blackholing and add separate BlackholePeerUntilSnapsh…
2023-02-14 11:56:37 +01:00
Benjamin Wang 1d8fe11ad9 dependency: bump golang.org/x/net from 0.5.0 to 0.6.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-14 17:40:47 +08:00
Benjamin Wang cc47f7bc7c dependency: bump gopkg.in/natefinch/lumberjack.v2 from 2.0.0 to 2.2.1
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-14 17:40:47 +08:00
Marek Siarkowicz e569217a6d tests: Refactor blackholing
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-14 09:38:10 +01:00
Marek Siarkowicz ed30d5415a
Merge pull request #15284 from serathius/funtional-remove
tests: Remove functional testing as they were replaced by linearizabi…
2023-02-13 12:32:04 +01:00
Benjamin Wang b4dfa9d34f test: correct the logic of comparing revision in linearizablity/watch.go
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-13 19:22:31 +08:00
Marek Siarkowicz 5f68ecc1ef tests: Remove functional testing as they were replaced by linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-11 13:20:44 +01:00
Benjamin Wang 87e271701b test: enhance the test case TestV3WatchProgressOnMemberRestart
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-10 20:09:26 +08:00
Benjamin Wang 36fc3cae65 clientv3: correct the nextRev on receving progress notification response
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-10 09:09:19 +08:00
Marek Siarkowicz 3c64ae4b79
Merge pull request #15239 from jmhbnz/main
Adjust time resolution to microseconds
2023-02-09 13:45:00 +01:00
Marek Siarkowicz d0575e4f18
Merge pull request #15268 from lavacat/main-before-follower-send-failpoint
tests: trigger raftBeforeFollowerSend failpoint in linearizability test
2023-02-09 09:45:58 +01:00
Bogdan Kanivets 4b91ae2800 tests: trigger raftBeforeFollowerSend failpoint in linearizability test
raftBeforeFollowerSend can only be triggered on Follower and won't work on 1 node cluster.
Had to split RandomFailpoint into RandomOneNodeClusterFailpoint and RandomMultiNodeClusterFailpoint

Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
2023-02-08 23:28:23 -08:00
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
Marek Siarkowicz 189d90ab7b tests: Validate watch responses in linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-06 16:58:17 +01:00
Bogdan Kanivets 91b056968d tests linearizability: trigger snapshot related failpoints
Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
2023-02-05 00:03:39 -08:00
Wei Fu 2183a55b47 tests: forcestop member procs with signal kill
When the linearizability test cases run with three members, it might take
7-8s to stop three members, especially stopping the leader. The leader
will transfer the leadership and it might take more time to stop peer
listener.

In order to reduce the runtime, this commit is using signal kill to force
stop members instead of graceful shutdown.

REF: #15086

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-02-03 23:06:40 +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
James Blair 5f27af9bb8
Fix regression in timestamp resolution
Historic capnslog timestamps are in microsecond resolution. We need to match that when we migrate to the zap logger.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-02-03 21:42:01 +13:00
Wei Fu 5a249fb3e2 tests/linearizability: remove PeerProxy for ClusterSize=1
Skip the peer traffic failpoint.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-02-01 18:04:11 +08:00
Marek Siarkowicz d814adbf94
Merge pull request #15227 from serathius/linearizability-trigger-fail
Linearizability disable defragment request in traffic to remove flakes
2023-02-01 09:26:08 +01:00
Marek Siarkowicz 90b839dda7 tests: Disable defrag command as it caused problems with defragBeforeCopy failpoint
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-31 12:48:23 +01:00
Marek Siarkowicz f4cc163190
Merge pull request #15156 from Nordix/add-minmax-allow-tls13
Add TLSv1.3 support.
2023-01-31 10:11:38 +01:00
Marek Siarkowicz 5ae405e646
Merge pull request #15202 from serathius/linearizability-logger
tests: Propagage logger through linearizability tests
2023-01-31 08:46:28 +01:00
Benjamin Wang 23e89b98a3 bump bbolt to v1.3.7
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-31 07:04:29 +08:00
Tero Saarni 588b98d085 Add TLSv1.3 support.
Added optional TLS min/max protocol version and command line switches to set
versions for the etcd server.

If max version is not explicitly set by the user, let Go select the max
version which is currently TLSv1.3. Previously max version was set to TLSv1.2.

Signed-off-by: Tero Saarni <tero.saarni@est.tech>
2023-01-30 16:16:53 +02:00
Marek Siarkowicz 0c004a6ce4 tests: Propagage logger through linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-30 14:30:21 +01:00
Marek Siarkowicz a8b6b05564
Merge pull request #15191 from serathius/linearizability-failpoints-timeout
tests: Increase failpoint timeout and add more logs
2023-01-30 14:05:23 +01:00
Marek Siarkowicz 535ade8eb2 tests: Increase failpoint timeout and add more logs
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-30 13:26:33 +01:00
Benjamin Wang 3d3cb460a0 test: reorder the import items in linearizability/model/model.go
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-29 06:12:03 +08:00
Marek Siarkowicz ef0bdbe489 tests: Implement LargePut requests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-24 22:29:31 +01:00
Marek Siarkowicz c50e602458 tests: Add defragment request to linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-24 21:49:57 +01:00
Marek Siarkowicz cc612821e7 tests: Deduplicate cluster test scenarios
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-24 18:41:42 +01:00
Marek Siarkowicz 45e11687c4 tests: Stop cluster after tests finish
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-24 15:48:01 +01:00
Marek Siarkowicz 207e0f74aa
Merge pull request #15159 from serathius/linearizability-separate-request-type
tests: Separate request type from Txn operation type
2023-01-24 13:47:55 +01:00
Benjamin Wang 5b8d7698c8 dependency: bump github.com/coreos/go-semver from 0.3.0 to 0.3.1
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-24 16:59:37 +08:00
Marek Siarkowicz 844ac9c76d tests: Separate request type from Txn operation type
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-23 22:59:28 +01:00
Marek Siarkowicz a581062c7a tests: Fix linearizability nightly
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-20 09:13:51 +01:00
Benjamin Wang 2af9d67943
Merge pull request #15133 from serathius/linearizability-history-persist
tests: Persist operation history
2023-01-19 05:08:49 +08:00
Marek Siarkowicz f629d48600 Close file while persisting operation history
Co-authored-by: Benjamin Wang <wachao@vmware.com>
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-18 09:43:30 +01:00
Marek Siarkowicz a0d12d316d tests: Add reproduce #13766 scenario
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-17 14:34:19 +01:00
Marek Siarkowicz f763c53d51 tests: Persist operation history
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-17 11:58:56 +01:00
Piotr Tabor 5d06650028
Merge pull request #15128 from serathius/linearizability-move-model
tests: Move linearizability model and identity to dedicated packages
2023-01-17 09:17:31 +01:00
Benjamin Wang ac98432f0b dependency: bump github.com/dustin/go-humanize from v1.0.0 to v1.0.1
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-17 06:37:19 +08:00
Marek Siarkowicz 96e2a7fbd6 tests: Move linearizability model and identity to dedicated packages
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-16 19:16:27 +01:00
Marek Siarkowicz 1257d0d919 tests: Fix history patch window
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-13 16:19:20 +01:00
Geeta Gharpure 6106912338 Lease support for linearizability tests : Updated as per review feedback.
Signed-off-by: Geeta Gharpure <geetagh@amazon.com>
2023-01-12 23:25:40 +00:00
Marek Siarkowicz 715a0047fa
Merge pull request #15091 from serathius/linearizability-stop-proxy
tests: Move stopping proxy to after process stop to speed up cluster …
2023-01-12 23:46:53 +01: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 bff3d4a592 tests: Fix putWithLease traffic timeout/limit and double overall timeout to reduce number of failed requests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-12 10:17:54 +01:00
Marek Siarkowicz 7b2dfece70 tests: Use watch events to patch history to speed up linearization
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-12 09:31:23 +01:00
Marek Siarkowicz 3306639b76
Merge pull request #15080 from geetasg/lease_support_refactor
Add support for lease api to linearizability tests
2023-01-11 15:34:36 +01:00
yanggang ebf1e3bb1a
Bump go to 1.19.5
Signed-off-by: yanggang <gang.yang@daocloud.io>
2023-01-11 14:42:31 +08:00
Geeta Gharpure 5b84526e9a Add support for lease api to linearizability tests
Signed-off-by: Geeta Gharpure <geetagh@amazon.com>
2023-01-11 05:19:57 +00:00
Marek Siarkowicz 8a9f848d33 tests: Refactor how linearizability test components are run in parallel
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-10 15:12:12 +01:00
Marek Siarkowicz 6821e226dd tests: Watch events during linearizability test and compare history
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-10 15:11:23 +01:00
Marek Siarkowicz 2965817150
Merge pull request #15046 from serathius/linearizability-failpoints-available
tests: Trigger only failpoints available in binary
2023-01-10 09:15:20 +01:00
Benjamin Wang 30fc7611e2 tidy up dependencies
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-10 09:11:34 +08: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 a992fb5e92
Merge pull request #15059 from serathius/linearizability-operations
tests: Rewrite etcd requests to use operations
2023-01-09 15:12:16 +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 6877122dca tests: Rewrite etcd requests to use operations
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-09 14:42:25 +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
Marek Siarkowicz bb86058fef tests: Test model describe method
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-01-01 19:54:16 +01:00
Marek Siarkowicz e73f55d4e9
Merge pull request #15028 from chaochn47/auth_test_split
tests/common: migrate auth tests #2
2023-01-01 18:58:39 +01:00
Benjamin Wang 9d6b49ed16
Merge pull request #15056 from ptabor/20221218-goimport-tests
Goimports: Apply automated fixing to test files as well.
2022-12-30 10:18:05 +08:00
Marek Siarkowicz 18a5dc417b
Merge pull request #14924 from serathius/linearizability-multiple-keys
tests: Support multiple keys in linearizability tests
2022-12-29 22:47:52 +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
Piotr Tabor 6f899a7b40
Merge pull request #15052 from ptabor/20221228-goimports-fix
./scripts/fix.sh: Takes care of goimports across the whole project.
2022-12-29 11:31:22 +01:00
Marek Siarkowicz d4c8611be9 tests: Add comments to linearizability functions
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
Co-authored-by: Benjamin Wang <wachao@vmware.com>
2022-12-29 10:02:21 +01:00
Piotr Tabor cf22f60e8b
Merge pull request #15053 from wafuwafu13/show-as-learner
enhancement(ctlv3): display `as learner` when member add as learner
2022-12-29 09:44:26 +01:00
Piotr Tabor 9e1abbab6e Fix goimports in all existing files. Execution of ./scripts/fix.sh
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-29 09:41:31 +01: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
wafuwafu13 4e8761b200 go fmt
Signed-off-by: wafuwafu13 <mariobaske@i.softbank.jp>
2022-12-29 13:18:23 +09:00
wafuwafu13 0c67e318d7 enhancement(ctlv3): display as learner when member add as learner
Signed-off-by: wafuwafu13 <mariobaske@i.softbank.jp>
2022-12-29 13:18:23 +09:00
Marek Siarkowicz ff71f34368 tests: Support multiple keys in linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-28 20:03:36 +01:00
Marek Siarkowicz a4c1b3a9e2
Merge pull request #15045 from serathius/linearizability-model
tests: Refactor etcd model
2022-12-28 20:01:00 +01:00
Benjamin Wang 9169522d72
Merge pull request #15021 from ramil600/em_manager
clientv3/naming/endpoints: fix endpoints prefix bug
2022-12-26 10:19:26 +08:00
Marek Siarkowicz de8b914eb0
Merge pull request #14909 from serathius/linearizability-issue14685-real
tests: Reproduce issue 14685
2022-12-25 06:48:22 +01:00
Marek Siarkowicz b108fabf86 tests: Reproduce issue 14685
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-24 21:26:57 +01:00
Marek Siarkowicz 922bed1ae6 tests: Refactor etcd model
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-24 21:12:32 +01:00
Ramil Mirhasanov f0153222f1 clientv3/naming/endpoints: fix endpoints prefix bug
fixes bug with multiple endpoints with same prefix

Signed-off-by: Ramil Mirhasanov <ramil600@yahoo.com>
2022-12-22 13:36:16 +03:00
Chao Chen a7da508ff6 tests/common: migrate auth tests #1
Signed-off-by: Chao Chen <chaochn@amazon.com>
2022-12-19 22:23:11 -08:00
Unai Arrien 8a75cfff67 Improve memberList output consistency
Signed-off-by: Unai Arrien <unaittxu@gmail.com>
2022-12-19 13:09:19 +01:00
Piotr Tabor 6fc0d96b42
Merge pull request #14993 from ramil600/add-log
clientv3/concurrency: add logger to session, add unit test
2022-12-19 10:30:38 +01:00
Benjamin Wang ba718c8303
Merge pull request #14918 from fuweid/revert-pr-12129
maintenance: add test to verify content of Snapshot
2022-12-18 06:37:48 +08:00
Benjamin Wang 614e520b97
Merge pull request #14998 from chaochn47/auth_test_split
tests/common: migrate auth tests #1
2022-12-17 14:23:35 +08:00
Ramil Mirhasanov 3c582fecb0 clientv3/concurrency: add logger to session, add unit test
Signed-off-by: Ramil Mirhasanov <ramil600@yahoo.com>
2022-12-16 11:11:35 +03:00
Wei Fu e58c73cc18 maintenance: add test to verify content of Snapshot
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-12-16 15:53:39 +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
Chao Chen 008df94901 tests/common: migrate auth tests #1
Signed-off-by: Chao Chen <chaochn@amazon.com>
2022-12-15 10:49:20 -08:00
Benjamin Wang 6e42da26e4
Merge pull request #14981 from etcd-io/dependabot/go_modules/tests/github.com/anishathalye/porcupine-0.1.4
build(deps): bump github.com/anishathalye/porcupine from 0.1.2 to 0.1.4 in /tests
2022-12-14 08:46:34 +08:00
dependabot[bot] c5d80b388b
build(deps): bump github.com/anishathalye/porcupine in /tests
Bumps [github.com/anishathalye/porcupine](https://github.com/anishathalye/porcupine) from 0.1.2 to 0.1.4.
- [Release notes](https://github.com/anishathalye/porcupine/releases)
- [Commits](https://github.com/anishathalye/porcupine/compare/v0.1.2...v0.1.4)

---
updated-dependencies:
- dependency-name: github.com/anishathalye/porcupine
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-13 22:32:23 +00:00
Benjamin Wang c4f7ac28a2 deps: bump go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc from 0.32.0 to 0.37.0 in /server
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 04:32:18 +08:00
Benjamin Wang 32840bae73 deps: bump go.opentelemetry.io/otel from 1.7.0 to 1.11.2
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 04:27:04 +08:00
Benjamin Wang 8f320bfa00 deps: bump github.com/golang-jwt/jwt/v4 from 4.4.2 to 4.4.3 in /server
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 04:19:10 +08:00
Benjamin Wang b96be4f1d3 deps: bump github.com/cheggaaa/pb/v3 from 3.0.8 to 3.1.0 in /etcdctl
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 04:03:53 +08:00
Benjamin Wang 2c192f4205 deps: bump go.uber.org/multierr from 1.8.0 to 1.9.0 in /server
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 04:00:49 +08:00
Benjamin Wang 700ad0fdce deps: bump github.com/creack/pty from 1.1.11 to 1.1.18 in /pkg
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 03:46:14 +08:00
Benjamin Wang c2a7a5870d deps: bump github.com/prometheus/client_golang from 1.12.2 to 1.14.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 03:42:11 +08:00
Benjamin Wang bc41c0963b deps: bump github.com/coreos/go-systemd/v22 from 22.3.2 to 22.5.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 03:38:55 +08:00
Benjamin Wang 259a73d67a deps: bump github.com/spf13/cobra from 1.4.0 to 1.6.1
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 03:33:24 +08:00
Benjamin Wang 1a0af6fee6 deps: bump go.uber.org/zap from 1.21.0 to 1.24.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-14 03:33:24 +08:00
Benjamin Wang 3c51c42417 test: fix nil pointer panic in testMutexLock
Refer to: https://github.com/etcd-io/etcd/actions/runs/3671847902/jobs/6207463700

```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xedc388]

goroutine 5253 [running]:
go.etcd.io/etcd/client/v3/concurrency.(*Session).Client(...)
	/home/runner/work/etcd/etcd/client/v3/concurrency/session.go:76
go.etcd.io/etcd/client/v3/concurrency.(*Mutex).tryAcquire(0xc000133140, {0x18a8668, 0xc000050158})
	/home/runner/work/etcd/etcd/client/v3/concurrency/mutex.go:111 +0x88
go.etcd.io/etcd/client/v3/concurrency.(*Mutex).Lock(0xc000133140, {0x18a8668, 0xc000050158})
	/home/runner/work/etcd/etcd/client/v3/concurrency/mutex.go:74 +0x68
go.etcd.io/etcd/tests/v3/integration/clientv3/experimental/recipes_test.testMutexLock.func1()
	/home/runner/work/etcd/etcd/tests/integration/clientv3/experimental/recipes/v3_lock_test.go:65 +0x285
created by go.etcd.io/etcd/tests/v3/integration/clientv3/experimental/recipes_test.testMutexLock
	/home/runner/work/etcd/etcd/tests/integration/clientv3/experimental/recipes/v3_lock_test.go:59 +0xda
FAIL	go.etcd.io/etcd/tests/v3/integration/clientv3/experimental/recipes	7.070s
FAIL
```

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-12 10:18:45 +08:00
Marek Siarkowicz 1bb4c9558d tests: Update gofail to v0.1.0
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-10 14:49:20 +01:00
Benjamin Wang 893a3e7356
Merge pull request #14916 from ahrtr/bump_go_1.19.4
Bump go to 1.19.4 and golang.org/x/net to v0.4.0 to address CVEs
2022-12-09 16:38:39 +08:00
Benjamin Wang 1ba246e1d8 bump golang.org/x/ to v0.4.0
Found 1 known vulnerability.

Vulnerability #1: GO-2022-1144
  An attacker can cause excessive memory growth in a Go server
  accepting HTTP/2 requests. HTTP/2 server connections contain a
  cache of HTTP header keys sent by the client. While the total
  number of entries in this cache is capped, an attacker sending
  very large keys can cause the server to allocate approximately
  64 MiB per open connection.

  Call stacks in your code:
Error:       tools/etcd-dump-metrics/main.go:158:5: go.etcd.io/etcd/v3/tools/etcd-dump-metrics.main calls go.etcd.io/etcd/server/v3/embed.StartEtcd, which eventually calls golang.org/x/net/http2.Server.ServeConn

  Found in: golang.org/x/net/http2@v0.2.0
  Fixed in: golang.org/x/net/http2@v0.4.0
  More info: https://pkg.go.dev/vuln/GO-2022-1144
Error: Process completed with exit code 3.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-09 08:54:48 +08:00
Benjamin Wang dccc21bb69 bump go 1.19.4
$ govulncheck ./...
govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulncheck-feedback.

Scanning for dependencies with known vulnerabilities...
Found 1 known vulnerability.

Vulnerability #1: GO-2022-1144
  An attacker can cause excessive memory growth in a Go server
  accepting HTTP/2 requests. HTTP/2 server connections contain a
  cache of HTTP header keys sent by the client. While the total
  number of entries in this cache is capped, an attacker sending
  very large keys can cause the server to allocate approximately
  64 MiB per open connection.

  Call stacks in your code:
      tools/etcd-dump-metrics/main.go:159:31: go.etcd.io/etcd/v3/tools/etcd-dump-metrics.main$4 calls go.etcd.io/etcd/server/v3/embed.StartEtcd, which eventually calls golang.org/x/net/http2.ConfigureServer$1

  Found in: golang.org/x/net/http2@v0.2.0
  Fixed in: golang.org/x/net/http2@v1.19.4
  More info: https://pkg.go.dev/vuln/GO-2022-1144

Vulnerability #2: GO-2022-1144
  An attacker can cause excessive memory growth in a Go server
  accepting HTTP/2 requests. HTTP/2 server connections contain a
  cache of HTTP header keys sent by the client. While the total
  number of entries in this cache is capped, an attacker sending
  very large keys can cause the server to allocate approximately
  64 MiB per open connection.

  Call stacks in your code:
      contrib/lock/storage/storage.go:106:28: go.etcd.io/etcd/v3/contrib/lock/storage.main calls net/http.ListenAndServe
      contrib/raftexample/httpapi.go:113:31: go.etcd.io/etcd/v3/contrib/raftexample.serveHTTPKVAPI$1 calls net/http.Server.ListenAndServe
      tools/etcd-dump-metrics/main.go:159:31: go.etcd.io/etcd/v3/tools/etcd-dump-metrics.main$4 calls go.etcd.io/etcd/server/v3/embed.StartEtcd, which eventually calls net/http.Serve
      tools/etcd-dump-metrics/main.go:159:31: go.etcd.io/etcd/v3/tools/etcd-dump-metrics.main$4 calls go.etcd.io/etcd/server/v3/embed.StartEtcd, which eventually calls net/http.Server.Serve

  Found in: net/http@go1.19.3
  Fixed in: net/http@go1.19.4
  More info: https://pkg.go.dev/vuln/GO-2022-1144

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-09 07:39:57 +08:00
Marek Siarkowicz 26bf2f81f5 tests: Add Txn operation to linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-08 23:57:42 +01:00
Marek Siarkowicz 60200b37d3 tests: Refactor etcd model
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-08 10:01:43 +01:00
Marek Siarkowicz 5ff9202027 tests: Refactor append failed requests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:21:07 +01:00
Marek Siarkowicz 619ca4f5cf tests: Add comments explaning handling failed requests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:11:22 +01:00
Marek Siarkowicz d8da98c49f tests: Fix return time for failed requests globally
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:11:22 +01:00
Marek Siarkowicz 45fdc2bbac tests: Extract history from client
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:11:22 +01:00
Marek Siarkowicz c5c2ea6aad tests: Enforce that revision doesn't skips without error
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:11:22 +01:00
Marek Siarkowicz fe6e42d411 tests: Improve tests by expending on scenarios
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:11:22 +01:00
Marek Siarkowicz 1d31e5e958 tests: Consider only latest failed request
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:11:22 +01:00
Marek Siarkowicz b922afc0a3 tests: Make etcdRequest and etcdResponse public to make it serializable
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:11:22 +01:00
Marek Siarkowicz 68fd863c87 tests: Mark failed requests as timed out
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:11:22 +01:00
Marek Siarkowicz 6a68141db5 tests: Allow dynamic number of clients
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 10:11:22 +01:00
Marek Siarkowicz 42bb543315
Merge pull request #14897 from serathius/linearizability-trigger-exit
Allow failpoint requests to fail assuming that process exists within 1 second
2022-12-06 09:31:21 +01:00
Marek Siarkowicz 2263315871
Merge pull request #14802 from geetasg/delete_api
linearizability tests - Add support for delete api
2022-12-06 09:30:59 +01:00
Marek Siarkowicz f2bc0823f6 tests: Make it explicit that we only suppurt panic failpoints
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 09:08:36 +01: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
Marek Siarkowicz a5cfc089fa tests: Refactor picking a member function
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-06 09:08:36 +01:00
Marek Siarkowicz 5baf8377bb
Merge pull request #14885 from serathius/linearizability-recreate-cluster
Linearizability recreate cluster
2022-12-05 12:16:00 +01:00
Piotr Tabor 40cc73c22e
Merge pull request #14889 from halegreen/fix-typo
test: fix typo
2022-12-04 16:33:35 +01:00
WangXiaoxiao f7f5474515 test:fix typo
Signed-off-by: WangXiaoxiao <1141195807@qq.com>
2022-12-04 21:11:12 +08:00
Marek Siarkowicz a573d8af69 tests: Use golang count to repeat tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-03 11:21:07 +01:00
Marek Siarkowicz 7f70b8cf76 tests: Separate retries count from failure trigger count
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-03 11:21:07 +01:00
Marek Siarkowicz df2d075e1a tests: Sleep between failpoint failure
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-03 11:21:07 +01:00
Marek Siarkowicz 11711fc007 tests: Recreate cluster for every failpoint trigger
This shortens operation history and avoids having to many failed requests.
Failed requests are problematic as too many of them can cause linearizability
verification complexity to become exponential.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-03 11:21:07 +01:00
Benjamin Wang 5503a9484a test: cleanup go.mod and go.sum files
Executed commands below,
1. Removed go.etcd.io/raft/v3 => ../raft;
2. go get go.etcd.io/raft/v3@eaa6808e1f7ab2247c13778250f70520b0527ff1;
3. go mod tidy

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-02 13:36:05 +08:00
Benjamin Wang 7ce21519fb test: update test to use the new raft module go.etcd.io/raft/v3
Just replaced all go.etcd.io/etcd/raft/v3 with go.etcd.io/raft/v3
under directory test.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-02 13:32:47 +08:00
Marek Siarkowicz ccf5d3c1af Cleanup comment
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-01 09:49:33 -08:00
Marek Siarkowicz eef1fb9246 Record delete request errors
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-12-01 09:49:22 -08:00
Geeta Gharpure 6be22d84ef Updated as per review feedback.
Signed-off-by: Geeta Gharpure <geetagh@amazon.com>
2022-12-01 09:39:26 -08:00
Geeta Gharpure de991a9f2d linearizability tests - Add support for delete api
Signed-off-by: Geeta Gharpure <geetagh@amazon.com>
2022-12-01 09:39:26 -08:00
Benjamin Wang 3f86db5e53 bump golang.org/x imports to address CVEs
Reference: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-32149

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-30 05:03:43 +08:00
Benjamin Wang 7b19ee6396 test: add integration test to cover the multiple member corruption case
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-26 19:35:38 +08:00
Benjamin Wang a3197102e9 test: rollback the change in PR pull/14824
The change did in https://github.com/etcd-io/etcd/pull/14824 fixed
the test instead of the product code. It isn't correct. After we
fixed the product code in this PR, we can revert the change in
that PR.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-26 19:35:38 +08:00
Benjamin Wang 285e44378f bump github.com/stretchr/testify from v1.7.2 to v1.8.1
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-26 10:51:32 +08:00
Benjamin Wang cd15507c65 test: enhance case TestEndpointHashKV to check both hash and hashRevision
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-25 18:49:16 +08:00
Marek Siarkowicz f18ac02e0f
Merge pull request #14834 from fuweid/bump-grpc-1.51
bump grpc to v1.51.0 from v1.47.0
2022-11-24 09:07:56 +01:00
Bhargav Ravuri dbfe42bbd2 comments: fix comments as per goword in go _test pkg files
Comments fixed as per goword in go _test package files that
shell function go_srcs_in_module lists as per changes on #14827

Helps in #14827

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
2022-11-24 00:03:00 +05:30
Bhargav Ravuri 2feec4fe68 comments: fix comments as per goword in go test files
Comments fixed as per goword in go test files that shell
function go_srcs_in_module lists as per changes on #14827

Helps in #14827

Signed-off-by: Bhargav Ravuri <bhargav.ravuri@infracloud.io>
2022-11-23 23:05:42 +05:30
Wei Fu cf285ea3c7 bump grpc to v1.51.0 from v1.47.0
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-11-23 22:16:22 +08:00
Marek Siarkowicz 51c0b4dff3
Merge pull request #14825 from clarkfw/EtcdProcessClusterConfig-antipattern-name
tests: fix anti-pattern name in `NewEtcdProcessCluster`
2022-11-23 15:11:36 +01:00
Andrew Sims f656fa0f49 add missing copyright headers
Signed-off-by: Andrew Sims <andrew.cameron.sims@gmail.com>
2022-11-23 19:13:43 +11: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
Wei Fu 0b30e83b1d tests/integration: deflake Corruption cases
If the corrupted member has been elected as leader, the memberID in alert
response won't be the corrupted one. It will be a smaller follower ID since
the raftCluster.Members always sorts by ID. We should check the leader
ID and decide to use which memberID.

Fixes: #14823

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-11-22 22:19:55 +08:00
Dirkjan Bussink c26dabacbd
release: build with consistent paths
This changes the builds to always add -trimpath which removes specific
build time paths from the binary (like current directories etc).

Improves build reproducability to make the final binary independent from
the specific build path.

Lastly, when stripping debug symbols, also add -w to strip DWARF symbols
as well which aren't needed in that case either.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
2022-11-21 15:06:11 +01: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
Benjamin Wang 6d8139dcea
Merge pull request #14788 from sashamelentyev/imports
all: goimports -w .
2022-11-18 09:03:43 +08:00
Benjamin Wang 2742bdc32a
Merge pull request #14752 from serathius/linearizability-raftBeforeLeaderSend
Linearizability raft before leader send
2022-11-18 08:56:11 +08:00
Sasha Melentyev c3b6cbdb73 all: goimports -w .
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-17 19:07:04 +03:00
Marek Siarkowicz 9b3bfcdfeb
Merge pull request #14798 from tjungblu/fix_locking_tests
Fix TestCtlV3Lock/Elect flakes
2022-11-17 15:40:47 +01:00
Marek Siarkowicz 371179e292 tests: Trigger raftBeforeLeaderSend
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-17 14:17:16 +01:00
Thomas Jungblut eebfd15983 Fix TestCtlV3Lock/Elect flakes
waiting for a proper exit after a signal should ensure the goroutines
don't leak.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2022-11-17 10:59:22 +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
Benjamin Wang 0c1901466f test: add test case to cover the CommonName based authentication
Refer to https://github.com/etcd-io/etcd/issues/14764

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-16 18:34:34 +08:00
Benjamin Wang 585054e448 test: add certificate with root CommonName
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-16 18:31:53 +08: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
Benjamin Wang 8438ddae3e
Merge pull request #14767 from sashamelentyev/print
all: Change Printf and friends to Print if there is no formatting
2022-11-16 10:38:20 +08:00
Sasha Melentyev 2c9c209eb6 all: Changing Printf and friends to Print if there is no formatting
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 22:11:23 +03:00
Marek Siarkowicz 8ae4420c4c tests: Add compact failpoints
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-15 15:00:18 +01:00
Benjamin Wang 39ca876f38
Merge pull request #14757 from ahrtr/add_failpoint_20221115
etcdserver: add failpoints for backend
2022-11-15 17:14:14 +08:00
Benjamin Wang cf190fb5b0 test: apply backend failpoints into the linearizablity test
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-15 16:36:56 +08: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
Benjamin Wang f49d96f8b7
Merge pull request #14756 from sashamelentyev/time
all: Change time unit
2022-11-15 15:54:30 +08:00
Benjamin Wang d62e018495
Merge pull request #14755 from serathius/linearizability-traffic
tests: Make linearizability traffic extendable
2022-11-15 09:11:40 +08:00
Sasha Melentyev 006e747a44 all: Change time unit
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 01:15:01 +03:00
Marek Siarkowicz 2fc1485f29 tests: Make linearizability traffic extendable
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-14 23:14:10 +01:00
Sasha Melentyev 855aa4f7a7 all: Use ReplaceAll instead of Replace with -1 pos
Signed-off-by: Sasha Melentyev <sasha@melentyev.io>
2022-11-15 00:06:09 +03:00
Marek Siarkowicz ca8baeb308
Merge pull request #14685 from serathius/linearizability-revision
Revision inconsistency caused by panic during defrag
2022-11-14 12:49:22 +01:00
Marek Siarkowicz 77cd6a660f
Merge pull request #14742 from fuweid/deflake-issue-14694
tests/e2e: disable testShellCompletion if enable cov flag
2022-11-14 12:41:40 +01:00
Marek Siarkowicz ff6c93f630 tests: Add revision to etcd linearizability model
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-14 12:20:55 +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
Wei Fu c2f27a0070 tests/e2e: disable testShellCompletion if enable cov flag
The etcdctl and etcdutl built with `-tags cov` mode will show go-test result
after each execution, like

```
...

PASS
coverage: 0.0% of statements in ./...
```

Since the PASS is not real command, the `source completion` command will
fail with command-not-found error. And there is no easy way to disable
the (*testing.M).Run's output. Therefore, this patch uses build tag !cov
to disable cases when enable coverage.

Fixes: #14694

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-11-14 17:58:18 +08:00
Benjamin Wang 2532ca84d1 test: add failpoints into linearizablity test for commitBeforePreCommitHook and commitAfterPreCommitHook
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-14 11:11:48 +08: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
Marek Siarkowicz d5a6d2518d tests: Optimize checking failed writes
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-13 13:36:21 +01: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
Marek Siarkowicz 2f558ca0db
Merge pull request #14714 from serathius/linearizability-data-dir
tests: Preserve data dir from failed linearizability tests
2022-11-10 13:58:23 +01:00
Marek Siarkowicz 04caec5960 tests: Preserve data dir from failed linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-10 11:05:59 +01:00
Benjamin Wang 0bff3ade4d
Merge pull request #14704 from chenyahui/mutex_unlock_state
etcdclient: check mutex state in Unlock method of concurrency.Mutex
2022-11-10 10:38:03 +08:00
Marek Siarkowicz 0d4a516d11
Merge pull request #14710 from tjungblu/downgrade_binary
Take binary version in Downgrade/Upgrade Test
2022-11-09 13:44:15 +01: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
Benjamin Wang b32cd938b3 test: add mix versions sending snapshot test
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-09 16:04:22 +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
chenyahui 5b8c6b548f etcdclient: check mutex state in Unlock method of concurrency.Mutex
Check the values of myKey and myRev first in Unlock method to prevent calling Unlock without Lock. Because this may cause the value of pfx to be deleted by mistake.

Signed-off-by: chenyahui <cyhone@qq.com>
2022-11-08 22:24:52 +08:00
Marek Siarkowicz 554b1bd0b0
Merge pull request #14687 from serathius/random-failpoint
tests: Add triggering random go failpoints to linearizability tests
2022-11-07 20:59:39 +01:00
Benjamin Wang 757cf33c00 test: update e2e test cases to use e2e specfic configuration from e2e package
Afer moving `ClusterVersion` and related constants into e2e packages,
some e2e test cases are broken, so we need to update them to use the
correct definitions.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-07 10:25:04 +08:00
Benjamin Wang 86e71f026e test: update the definition of testRunner and clusterTestCases
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-07 10:18:51 +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
Marek Siarkowicz 219278b298 tests: Add triggering random go failpoints to linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-06 15:56:28 +01:00
Benjamin Wang c00ede393f test: fix pipeline errors due to PRs conflict
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-06 06:28:51 +08:00
Hitoshi Mitake 49db50c117
Merge pull request #14663 from ahrtr/auth_20221031
auth: check permission when performing maintainenence operations if auth is enabled
2022-11-05 23:13:29 +09: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
Benjamin Wang f782891246 test: added auth test on maintenance API
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:39:42 +08:00
Benjamin Wang 1791ab5754 test: add common functions for auth test
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:39:42 +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
Benjamin Wang 94e0c2410b bump go version to 1.19.3 to address security fixes
FYI. https://groups.google.com/g/golang-announce/c/dRtDK7WS78g

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-02 09:07:22 +08:00
spacewander e73a25a1d0 ci: ensure the generated code is up-to-date
See https://github.com/etcd-io/etcd/pull/14612#issue-1419792069
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2022-10-31 19:58:21 +08:00
Benjamin Wang 5073af6521
Merge pull request #14660 from clarkfw/new-cluster-accept-configuration-as-options
tests: TestRunner.NewCluster accepts options
2022-10-31 19:15:23 +08:00
Clark fa9ee5cce9 tests: TestRunner.NewCluster accepts options
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-10-31 15:26:08 +08:00
Benjamin Wang a1018dbddf
Merge pull request #14604 from ahrtr/double_barrier
clientv3: fix the implementation of double barrier
2022-10-31 08:13:12 +08:00
Benjamin Wang d1f7136a50
Merge pull request #14621 from ahrtr/functional_test_20221025
test: terminate functional test on failure and code cleanup
2022-10-31 07:42:29 +08:00
vivekpatani 680310a6c9 *: bump to go1.19.2 from 1.19.1
- update .github workflows
- update tests

Signed-off-by: vivekpatani <9080894+vivekpatani@users.noreply.github.com>
2022-10-27 18:45:02 -07:00
Oleg Guba fbed8cb645 etcdserver: call refreshRangePermCache on Recover() in AuthStore
Signed-off-by: Oleg Guba <oleg@dropbox.com>
2022-10-27 15:05:05 -07: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
Marek Siarkowicz c45f3388ac
Merge pull request #14632 from clarkfw/functional-options-pattern-of-cluster-config
tests: add a ClusterOption interface for ClusterSize in config.Cluster
2022-10-27 16:29:57 +02: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
Clark e28b66f751 tests: add a ClusterOption interface for ClusterSize in config.ClusterConfig
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-10-26 23:41:09 +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
Benjamin Wang 5550041633
Merge pull request #14629 from clarkfw/fix-anti-pattern-naming
test: fix anti-pattern naming problem in config.ClusterConfig
2022-10-26 20:01:43 +08:00
Clark 08284c56e0 test: fix anti-pattern naming problem in config.ClusterConfig
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-10-26 15:47:19 +08:00
Benjamin Wang 42cfb74b4c test: define a default WithAuth to resolve error Unresolved reference 'WithAuth' from IDE
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-26 14:30:47 +08: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
Benjamin Wang 36cbd6aff3 test: terminate functional test on failure
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-25 17:15:11 +08:00
Benjamin Wang 3ee2f5711e test: add common function "WithAuth"
We defines two common `WithAuth` functions for e2e and integration
test respectively. They are calling `integration.WithAuth` and
`e2e.WithAuth` respectively.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-25 02:41:49 +08: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 61c8888440
Merge pull request #14602 from ahrtr/enhance_functional_test_20221020
functional_test: code cleanup and minor enhancements
2022-10-23 11:00:25 +08: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
Benjamin Wang 62167d1f1f clientv3: fix the design & implementation of double barrier
Check the client count before creating the ephemeral key, do not
create the key if there are already too many clients. Check the
count after creating the key again, if the total kvs is bigger
than the expected count, then check the rev of the current key,
and take action accordingly based on its rev. If its rev is in
the first ${count}, then it's valid client, otherwise, it should
fail.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-20 16:24:20 +08:00
Benjamin Wang bbda1daecf functional_test: code cleanup and minor enhancements
Cleaned up some useless or dead code;
Remove some unnecessary methods.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-20 10:35:30 +08: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 0f9e15fc37 test: Remove accessing etcd via BinDir
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
Marek Siarkowicz de0efc9aa4 tests: Move global e2e configuration into one file
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-17 14:09:28 +02:00
Marek Siarkowicz 07ca384753 tests: Move MustAbsPath function to testutils
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-10-17 13:37:14 +02:00