272 Commits

Author SHA1 Message Date
Hitoshi Mitake
617f1df443 Remove string dependent error handling in watch and auth
Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
2024-02-06 19:25:53 +09:00
Wei Fu
fdf1e28a3f integration: deflake TestMaintenanceSnapshotCancel
Unlike SnapshotWithVersion, the client.Snapshot doesn't wait for first
response. The server could open db after we close connection or shutdown
the server. We can read few bytes to ensure server opens boltdb.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2024-01-12 19:24:10 +08:00
Siyuan Zhang
b3a5307640 add tests to test tx delete consistency.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-01-10 09:33:13 -08:00
Benjamin Wang
f7be2dfa17
Merge pull request #16888 from greenmoon55/greenmoon55-patch-1
tests: add comments for clientv3test.TestWatchResumeInitRev
2023-12-16 20:35:43 +00:00
Benjamin Wang
67f17166bf Safeguard lease operations by double checking the leadership
1. ignore old leader's leases revoking request
2. double check current member's leadership before perform lease renew request
3. etcdserve: ensure current member's leadership before performing lease checkpoint request

Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2023-12-15 17:53:36 +00:00
Jin Dong
4c853774e6 Rename the test and update comments
Signed-off-by: Jin Dong <greenmoon55@gmail.com>
2023-11-28 02:32:50 +00:00
Jin Dong
f2d718e641
Merge branch 'etcd-io:main' into greenmoon55-patch-1 2023-11-27 21:14:59 -05:00
shaoqin4
089165deec clientv3test: add comments for clientv3test
Signed-off-by: shaoqin2 <21689677+shaoqin2@users.noreply.github.com>
2023-11-15 08:25:39 -05:00
greenmoon55
00ce0116c5 tests: add comments for clientv3test.TestWatchResumeInitRev
Signed-off-by: Jin Dong <greenmoon55@gmail.com>
2023-11-08 00:04:48 -06:00
Benjamin Wang
d8c410ff82
Merge pull request #16791 from chaochn47/remove-deprecated-gRPC-API
remove deprecated gRPC API usage
2023-10-18 11:13:09 +01:00
Chao Chen
3c6d2e972d remove deprecated gRPC API usage
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-10-17 15:51:25 -07:00
Wei Fu
aea1cd0077 feat: enable unparam lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-17 21:24:13 +08:00
Wei Fu
8870cb3070 *: fix unconvert linter
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-25 19:40:45 +08:00
Wei Fu
07effc4d0a *: fix revive linter
Remove old revive_pass in the bash scripts and migirate the revive.toml
into golangci linter_settings.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-24 14:21:11 +08:00
Wei Fu
aa97484166 *: enable goimports in verify-lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-21 21:14:09 +08:00
Wei Fu
9c3edfa0af *: fix staticcheck lint
Changed TraceKey/StartTimeKey/TokenFieldNameGRPCKey to struct{} to
follow the correct usage of context. Similar patch to #8901.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-21 11:24:26 +08:00
Wei Fu
df86cadd8b *: fix ineffassign lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-19 22:19:19 +08:00
Wei Fu
5e3910d96c *: fix govet-shadow lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-19 20:24:01 +08:00
chenyahui
c0aa3b613b Use any instead of interface{}
Signed-off-by: chenyahui <cyhone@qq.com>
2023-09-17 17:41:58 +08:00
Benjamin Wang
5dd5fe35d0 test: de-flake test case TestV3WatchProgressOnMemberRestart
The case may be blocked on sending progress notification, so may
not be able to exit the goroutine.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-09-05 15:04:02 +01:00
Jes Cok
52748f60f3 all: stop using math/rand.Seed
Fixes #16428.

Signed-off-by: Jes Cok <xigua67damn@gmail.com>
2023-08-20 16:34:44 +08:00
Benjamin Wang
eb04f3ad8d
Merge pull request #16338 from chaochn47/bump-up-grpc
Fix 15877 and bump up gRPC from v1.52.0 to v1.57.0
2023-08-02 08:36:02 +01:00
Benjamin Wang
f3a03247df
Merge pull request #16265 from kensou97/expose-session-context
clientv3: add Ctx() to return context of session
2023-08-01 17:09:01 +01:00
Benjamin Wang
8524903935
Merge pull request #16223 from kensou97/fix-barrier
clientv3: fix barrier.Wait() still block after barrier.Release()
2023-08-01 17:08:17 +01:00
Chao Chen
24c6fb4b4d Fix 15877 and bump up gRPC from v1.52.0 to v1.57.0
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-07-31 13:57:24 -07:00
Chao Chen
8aeed09f2c endpoints.Interpret returns Host:port as ServerName
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-07-28 16:19:54 -07:00
zhangwenkang
c3e5201972 clientv3: fix barrier.Wait() still block after barrier.Release() in some cases
Signed-off-by: Wenkang Zhang <314830391@qq.com>
2023-07-18 15:48:48 +08:00
Wenkang Zhang
03d8fff0d8 clientv3: add Ctx() to return context of session
Signed-off-by: Wenkang Zhang <314830391@qq.com>
2023-07-18 15:22:53 +08:00
Rajalakshmi Girish
ea72194935 Fix flaky integration/clientv3/naming TestEtcdGrpcResolverRoundRobin
Signed-off-by: Rajalakshmi Girish <rajalakshmi.girish1@ibm.com>
2023-07-17 23:53:02 -07:00
Benjamin Wang
93bfdba265
Merge pull request #16156 from kensou97/fix-barrier
clientv3: remove v3.WithFirstKey() in Barrier.Wait()
2023-07-06 08:29:21 +01:00
caojiamingalan
eff9517a90 etcdserver: add cluster id check for hashKVHandler
Signed-off-by: caojiamingalan <alan.c.19971111@gmail.com>
2023-07-05 14:09:40 -05:00
zhangwenkang
3d3e91c6e3 clientv3: remove v3.WithFirstKey() in Barrier.Wait()
fix the unexpected blocking when using Barrier.Wait(), e.g.
NewBarrier(client, "a").Wait() will block if key "a" is not existed but "a0" is existed, but it should return immediately.

Signed-off-by: zhangwenkang <zwenkang@vmware.com>
2023-07-04 22:01:54 +08:00
Chao Chen
6cdc9ae4fe server/etcdserver/raft.go:
1. rename confChangeCh to raftAdvancedC
2. rename waitApply to confChanged
3. add comments and test assertion

Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-06-26 22:42:44 -07:00
Chao Chen
6d79b86219 Enable failpoint by default in integration tests
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-06-21 23:13:46 -07:00
Benjamin Wang
2df32102ca
Merge pull request #15835 from yellowzf/grpcproxy_fix_memberlist_results_not_update_when_proxy_node_down
grpcproxy: fix memberlist results not update when proxy node down
2023-05-15 13:34:05 +08:00
yellowzf
ca221208d2 grpcproxy: fix memberlist results not update when proxy node down
If start grpc proxy with --resolver-prefix, memberlist will return all alive proxy nodes, when one grpc proxy node is down, it is expected to not return the down node, but it is still return

Signed-off-by: yellowzf <zzhf3311@163.com>
2023-05-15 10:59:02 +08:00
Benjamin Wang
52dfd4bbed
Merge pull request #15867 from chaochn47/auth_test_split_8
migrate e2e auth tests to common #8
2023-05-13 14:21:37 +08:00
Chao Chen
c846b087db migrate e2e auth tests to common #8
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-05-12 22:51:47 -07:00
Benjamin Wang
05b663fbe8
Merge pull request #15828 from chaochn47/add_leadership_transfer_coverage
tests/e2e: add graceful shutdown test
2023-05-11 07:39:25 +08:00
James Blair
3f5ad36039
Deflake TestEtcdGrpcResolverRoundRobin.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-05-10 21:03:01 +12:00
Chao Chen
f31d0eafb9 tests/e2e: add graceful shutdown test
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-05-09 17:08:53 -07:00
Benjamin Wang
b404d25d84
Merge pull request #15741 from AngstyDuck/set-default-value-for-AutoCompactionMode
server: default value for config file field auto-compaction-mode is n…
2023-05-10 05:44:16 +08:00
AngstyDuck
a7344da7d3 server: default value for config file field auto-compaction-mode is now 'periodic'; added additional checks if auto-compaction-mode is undefined
Signed-off-by: AngstyDuck <solsticedante@gmail.com>
2023-05-09 23:10:44 +08:00
Hitoshi Mitake
49b59cc8e5
Merge pull request #15656 from mitake/lease-timetolive-auth
protect LeaseTimeToLive with RBAC
2023-05-02 23:02:29 +09:00
James Blair
b9533ca98b
Deflake TestEtcdGrpcResolverRoundRobin.
Increase request to 1000 to increase sample size/reduce variability and increase tolerance threshold from 10 to 15%.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-04-29 14:14:16 +12:00
Hitoshi Mitake
c9b368119e tests: e2e and integration test for timetolive
Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
Co-authored-by: Benjamin Wang <wachao@vmware.com>
2023-04-26 20:35:20 +09:00
James Blair
18e3acae0e
Add new test for round robin resolver.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-04-25 18:44:24 +12:00
Wei Fu
50aa00b203 tests: make log monitor as common helper
It's followup of #15667.

This patch is to use zaptest/observer as base to provide a similar
function to pkg/expect.Expect.

The test env

```bash
11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
mkdir /sys/fs/cgroup/etcd-followup-15667
echo 0-2 | tee /sys/fs/cgroup/etcd-followup-15667/cpuset.cpus # three cores
```

Before change:

* memory.peak: ~ 681 MiB
* Elapsed (wall clock) time (h:mm:ss or m:ss): 6:14.04

After change:

* memory.peak: ~ 671 MiB
* Elapsed (wall clock) time (h:mm:ss or m:ss): 6:13.07

Based on the test result, I think it's safe to be enabled by default.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-04-18 09:00:24 +08:00
Wei Fu
9f034fbaa8 chore: use tools/mod to lock the cfssl cmd version
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-04-13 12:06:31 +08:00
Wei Fu
8cd5969248 chore: use strict mode for tests/*/*.sh
REF: #15514

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-04-13 12:05:39 +08:00