Commit Graph

312 Commits (3cea310b6161f164cd789d5664dee4b6e07f45ff)

Author SHA1 Message Date
Gyuho Lee 33907477dd *: add "etcd_server_client_requests_total", tests
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-03-17 12:16:11 -07:00
Jingyi Hu 84ace97ad7
Merge pull request #11572 from lzhfromustc/API_Fatal_4
integration/clientv3: fix 4 API misusage in test functions
2020-02-14 00:27:41 -08:00
Ziheng Liu f00394e384 integration/clientv3: fix 4 API misusage in test functions 2020-02-13 13:13:18 -05:00
sfzhu93 cad92706cf
in multiple packages: fixed goroutine leak bugs in tests (#11569) 2020-01-30 10:45:59 -08:00
Gyuho Lee 993e82a85b clientv3/integration: fix a typo in "TestLeasingTxnRangeCmp"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-01-19 23:56:22 -08:00
Gyuho Lee 2669b83c68 clientv3/integration: fix typo in "TestLeasingRevGet"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-01-19 10:20:23 -08:00
Gyuho Lee 091b84f154 clientv3/integration: fix "TestLeaseKeepAliveNotFound"
with "default" select, the failure case will never be selected

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-01-17 12:04:10 -08:00
Gyuho Lee 255944bf51 clientv3/integration: expect "ErrCompacted" in "TestKVCompact"
Making tests more strict

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-01-17 12:03:13 -08:00
Jingyi Hu ed5a01a48d etcdserver: recover cluster version from backend 2019-12-05 16:25:13 -08:00
Guangming Wang 6287052bd0 integration: fix bug in for loop, make it break properly 2019-09-17 11:27:31 +08:00
Jingyi Hu 2680c2afe7 integration: fix TestKVPutError
Give backend quota enough overhead.
2019-08-21 19:56:38 -07:00
Gyuho Lee b5aa46486b clientv3/integration: fix "mvcc.NewStore" call
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-15 11:48:53 -07:00
Zeming YU 181419256d integration: fix a data race about `err`
don't share `err` between goroutines
2019-08-06 14:58:15 -07:00
Gyuho Lee 9b385737f5 clientv3: deprecate "grpc.ErrClientConnClosing"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-08-05 13:27:16 -07:00
Gyuho Lee ba42e65b59 clientv3/integration: give more time for balancer resolution
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-07-26 09:19:22 -07:00
Sahdev P. Zala 1cef112a79 etcdserver: do not allow creating empty role
Like user, we should not allow creating empty role.

Related #10905
2019-07-24 17:41:24 -04:00
Gyuho Lee 1caaa9ed4a test: test update for Go 1.12.5 and related changes
Update to Go 1.12.5 testing. Remove deprecated unused and gosimple
pacakges, and mask staticcheck 1006. Also, fix unconvert errors related
to unnecessary type conversions and following staticcheck errors:
- remove redundant return statements
- use for range instead of for select
- use time.Since instead of time.Now().Sub
- omit comparison to bool constant
- replace T.Fatal and T.Fatalf in tests with T.Error and T.Fatalf respectively because the goroutine calls T.Fatal must be called in the same goroutine as the test
- fix error strings that should not be capitalized
- use sort.Strings(...) instead of sort.Sort(sort.StringSlice(...))
- use he status code of Canceled instead of grpc.ErrClientConnClosing which is deprecated
- use use status.Errorf instead of grpc.Errorf which is deprecated

Related #10528 #10438
2019-06-05 17:02:05 -04:00
Jingyi Hu ec17872c98 integration: add member promote failure test cases
Add TestMemberPromoteMemberNotLearner and
TestMemberPromoteMemberNotExist.
2019-05-31 10:52:54 -07:00
Jingyi Hu 6bf609b96d integration: update TestMemberPromote test
Update TestMemberPromote to include both learner not-ready and learner
ready test cases.

Removed unit test TestPromoteMember, it requires underlying raft node to
be started and running. The member promote is covered by the integration
test.
2019-05-28 18:50:13 -07:00
Jingyi Hu f8ad8ae4ad etcdserver: use etcdserver ErrLearnerNotReady
If learner is not ready to be promoted, use etcdserver.ErrLearnerNotReady
instead of using membership.ErrLearnerNotReady.
2019-05-28 18:50:13 -07:00
宇慕 dfe296ac3c etcdserver: add mayPromote check 2019-05-28 18:47:03 -07:00
Jingyi Hu 7a4d233bab clientv3/integration: better way to deflake test
Use ReadyNotify instead of time.Sleep to wait for server ready.
2019-05-28 18:47:03 -07:00
Jingyi Hu aa4cda2f5c etcdserver: allow 1 learner in cluster
Hard-coded the maximum number of learners to 1.
2019-05-28 18:47:03 -07:00
Jingyi Hu d0c1b3fa38 etcdserver: learner return Unavailable for unsupported RPC
Make learner return code.Unavailable when the request is not supported
by learner. Client balancer will retry a different endpoint.
2019-05-28 18:47:03 -07:00
Gyuho Lee 34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
Jingyi Hu 23f1d02391 *: address comments 2019-05-15 15:58:46 -07:00
Jingyi Hu 90d28c0de7 clientv3/integration: deflake TestKVForLearner
Adding delay in the test for the newly started learner member to catch
up applying config change entries in raft log.
2019-05-15 13:58:28 -07:00
Jingyi Hu b23c8f3e8f clientv3/integration: fix cluster tests
Fixes TestMemberAddForLearner and TestMemberPromoteForLearner.
2019-05-15 13:58:26 -07:00
WizardCXY a039f2efb8 clientv3, etcdctl: MemberPromote for learner 2019-05-15 13:48:52 -07:00
Jingyi Hu 57a11eb1e1 integration: add TestKVForLearner
Adding TestKVForLearner. Also adding test utility functions for clientv3
integration tests.
2019-05-15 13:27:38 -07:00
Jingyi Hu 2b76200f70 *: add MemberAddAsLearner to clientv3 Cluster API
Made changes to Clientv3 Cluster API:

- Added MemberAddAsLearner.
- Reverted changes to MemberAdd - removed input parameter isLearner.
2019-05-14 16:56:44 -07:00
Jingyi Hu fc14608cb7 clientv3: support MemberAdd for learner
Added IsLearner flag to clientv3 MemberAdd API.
2019-05-14 13:10:22 -07:00
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
zhoulin xie cc08c1bd2e clientv3/integration/leasing_test.go: Fix t.Fatalf error message
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-04-10 13:19:50 -04:00
Jingyi Hu 9bd86a647f clientv3: Add TestMemberAddWithExistingURLs
TestMemberAddWithExistingURLs ensures adding a new member with URLs
already being used in the cluster will not succeed.
2019-03-18 12:48:44 -07:00
Xiang Li e80d1745be
Merge pull request #10420 from spzala/watch10340
clientV3watch: do not return ctx canceled when Close watch
2019-03-08 11:57:44 -08:00
Sahdev P. Zala b25edb62cc clientV3watch: Watch Close should close successfully
Closing of watch by client will cancel the watch grpc stream and
can produce a context canceled error. However, since client
simply wanted to close the watcher the error can create confusion
that something went wrong instead of a successful close. Ensure
that Close do not return error.

Fixed #10340
2019-02-28 20:43:20 -05:00
caoming 94b782e7c9 clientv3/integration: add timeout case. 2019-02-18 09:38:49 +08:00
Xiang Li 3546c4868c
Merge pull request #10445 from spzala/fromkey9833
clientv3: fix WithFromKey
2019-02-07 14:50:13 -08:00
Sahdev P. Zala 313ab0ba47 clientv3: fix WithFromKey
The WithFromKey func should not return error similar to etcdctl usage
of it when an empty key is provided.

Fixed #9833
2019-02-02 19:21:49 -05:00
cfc4n a033686acf clientv3/integration: return err if err == rpctypes.ErrAuthNotEnable 2019-02-02 14:06:54 +08:00
nolouch 6ea54195a6 client/integration: try to fix tests 2018-09-18 01:44:57 +08:00
nolouch c15fb607f6 server: broadcast leader changed 2018-09-17 14:15:04 +08:00
nolouch fd5ef74b80 clientv3/integration: try to fix tests 2018-09-14 17:57:56 +08:00
nolouch f3f6427586 server: prevent blocking 2018-09-14 16:08:29 +08:00
nolouch 4de27039cb server: drop read request if found leader changed 2018-09-14 15:58:35 +08:00
Gyuho Lee 839f202195 clientv3/integration: fix race condition from closing channel
Go 1.11 now marks len(channel) over being-closed channel
as racey operation, fix tests by receiving from channel first
and then check the length of channel.

```
WARNING: DATA RACE
Write at 0x00c000e872c0 by goroutine 198:
  runtime.closechan()
      /usr/local/go/src/runtime/chan.go:327 +0x0
  go.etcd.io/etcd/clientv3.(*lessor).closeRequireLeader()
      /Users/leegyuho/go/src/go.etcd.io/etcd/clientv3/lease.go:379 +0x748
  go.etcd.io/etcd/clientv3.(*lessor).recvKeepAliveLoop()
      /Users/leegyuho/go/src/go.etcd.io/etcd/clientv3/lease.go:455 +0x3a5

Previous read at 0x00c000e872c0 by goroutine 27:
  go.etcd.io/etcd/clientv3/integration.TestLeaseWithRequireLeader()
      /Users/leegyuho/go/src/go.etcd.io/etcd/clientv3/integration/lease_test.go:828 +0x810
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:827 +0x162
```

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 22:27:11 -07:00
Gyuho Lee 2ac04381a2 clientv3: update Go import paths to "go.etcd.io"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 17:47:55 -07:00
Gyuho Lee aeb418b815 clientv3/integration: remove "transport.ErrConnClosing" match
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-08-09 19:27:37 -07:00
Joe Betz 67bcf28c4e
clientv3: Use passthrough resolver for direct endpoint dialing 2018-07-27 10:15:02 -07:00