Commit Graph

271 Commits (cbfe0b4b79de7bbb5ed7ce6772df8b64b39969b9)

Author SHA1 Message Date
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
Joe Betz a2ecd6b676
clientv3: Simplify TestDialTLSNoConfig now that dial with grpc.WithBlock correctly results in a client timeout error 2018-07-24 10:45:03 -07:00
Joe Betz b3b06a862a
clientv3: Fix maintenance APIs to directly dial grpc endpoints correctly. 2018-07-23 11:20:15 -07:00
Gyuho Lee 0458c5d54b
Merge pull request #9951 from gyuho/revive
*: integrate https://github.com/mgechev/revive with fmt tests
2018-07-23 06:39:33 -07:00
Gyuho Lee f3385418bb clientv3: fix keepalive send interval when response queue is full
client should update next keepalive send time
even when lease keepalive response queue becomes full.

Otherwise, client sends keepalive request every 500ms
regardless of TTL when the send is only expected to happen
with the interval of TTL / 3 at minimum.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-22 17:59:32 -07:00
Gyuho Lee 90a5da18cf clientv3: clean up code format
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-21 16:03:12 -07:00
Joe Betz 4b51b6de49
*: Add progress notify request watch request 2018-06-27 16:46:13 -07:00
Gyuho Lee 6e521d2f3f clientv3: add "IsConnCanceled", deprecate "grpc.ErrClientConnClosing"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 14:47:08 -07:00
Joe Betz 3b84117f54 clientv3/integration: Add err check to TestDialTLSNoConfig to prevent nil pointer dereference on c.Close() 2018-06-15 13:41:28 -07:00
Joe Betz 55ef9cc1d0 clientv3: Add auth retry to retry interceptor 2018-06-15 13:41:28 -07:00
Joe Betz a5b2fb5563 clientv3: Introduce custom retry interceptor based on go-grpc-middleware/retry 2018-06-15 13:41:28 -07:00
Joe Betz 1f6548b751 clientv3: Stop expecting retry in integration tests with new grpc balancer 2018-06-15 13:41:28 -07:00
Joe Betz 8569b9c782 clientv3: Fix endpoint resolver to create a new resolver for each grpc client connection 2018-06-15 13:41:28 -07:00
Joe Betz 9304d1abd1 clientv3: Fix TLS test failures by returning DeadlineExceeded error from dial without any additional wrapping 2018-06-15 13:41:28 -07:00
Gyuho Lee 7284e5a0a9 clientv3/integration: fix "TestMaintenanceSnapshotErrorInflight"
Errors from gRPC should be typed *status.statusError

=== RUN   TestMaintenanceSnapshotErrorInflight
WARNING: 2018/05/29 11:43:21 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: Error while dialing dial unix localhost:55815860381826373260: connect: no such file or directory"; Reconnecting to {localhost:55815860381826373260 0  <nil>}
--- FAIL: TestMaintenanceSnapshotErrorInflight (2.42s)
	maintenance_test.go:192: expected context deadline exceeded, got rpc error: code = DeadlineExceeded desc = context deadline exceeded

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-29 11:49:18 -07:00
Gyuho Lee 19eb8a5132 clientv3/integration: do not run fragmentation tests with gRPC Proxy
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-18 10:45:03 -07:00
Gyuho Lee 56ec416eba clientv3/integration: test watch response fragmentation
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-14 13:34:54 -07:00
Gyuho Lee f6a14fb72c clientv3: use "zap" logger in integration tests
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-01 16:15:09 -07:00
Gyuho Lee 6dbce6b9a4 clientv3,etcdctl: support structured logger
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-16 17:36:00 -07:00
Gyuho Lee 3a7b5c1b2b clientv3/integration: log test failures from slow balancer as TODO
Balancer tests have been flaky since last balancer rewrite.
Should be from slow balancer failover. Once we re-rewrite balancer
with roundrobin, there should be no more flaky tests as below:

TestBalancerUnderServerStopInflightLinearizableGetOnRestart (27.62s)
server_shutdown_test.go:343: context deadline exceeded

TestBalancerUnderServerShutdownDelete (3.22s)
util.go:32: context deadline exceeded

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-10 13:47:07 -07:00
Gyuho Lee a60bb6104c *: regenerate "fixtures-expired"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-09 10:59:52 -07:00
Gyuho Lee e280f8c3da clientv3/integration: adjust timeouts for TestLeasingReconnectOwnerRevoke
Now Restart takes longer, and leasing Get blocks
on server restarts anyway, so fix CI failures in
slow machines.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-08 10:58:18 -08:00
Gyuho Lee 3e69dc5a7c clientv3/integration: test "rpctypes.ErrLeaseTTLTooLarge"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-08 10:19:30 -08:00
Gyuho Lee 8a518b01c4 *: revert "internal/mvcc" change
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee dd2f3b0de8 *: revert "internal/lease" change
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 80d15948bc *: move "mvcc" to "internal/mvcc"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-26 11:14:41 -08:00
Gyuho Lee 349a377a67 *: move "lease" to "internal/lease"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-26 11:09:29 -08:00
Gyuho Lee c837e01c7f clientv3/integration: add TestMemberAddUpdateWrongURLs
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-22 11:24:15 -08:00
Sahdev P. Zala 3b7e2ce0ca StatusFromError: handle return value of the function
status.FromError can return nil, false. We are handling the return values
most places in code but some places we aren't. Fixing it herewith.

Fixes #9117
2018-01-08 22:28:20 -05:00
Gyuho Lee 7b4fc2601c clientv3/integration: fix typos
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-03 17:26:43 -08:00
Sam Batschelet d21fef2d41 integration: add constant RequestWaitTimeout. 2018-01-03 15:53:57 -05:00
Gyuho Lee 806ff6dff9 clientv3/integration: fix TestKVLargeRequests with -tags cluster_proxy
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-02 10:50:29 -08:00
Gyuho Lee 88fe8de99b clientv3/integration: fix TestKVPutError
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-20 10:58:05 -08:00
Gyuho Lee f38593bbad clientv3/integration: test large KV requests
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-20 10:58:05 -08:00
Gyuho Lee f87760998b clientv3: call KV/Txn APIs with default gRPC call options
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-20 10:58:05 -08:00
Gyuho Lee 7cd985bdac clientv3: translate Snapshot API gRPC status error
To be consistent with other APIs.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2017-12-19 10:46:19 -08:00
Gyu-Ho Lee a7cb307a18 clientv3/integration: add more tests on balancer switch, inflight range
Test all possible cases of server shutdown with inflight range requests.
Removed redundant tests in kv_test.go.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-27 15:05:12 -08:00
Gyu-Ho Lee bd76ac85db clientv3/integration: move isServerCtxTimeout to server_shutdown_test.go
Tests with cluster_proxy tags were failing, since isServerCtxTimeout
was defined with "+build !cluster_proxy".

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-27 15:02:48 -08:00
Gyu-Ho Lee 0d0e8e78f7 clientv3/integration: handle server-side context timeouts from clock-drift
Due to clock drifts in server-side, client context times out
first in server-side, while original client-side context is
not timed out yet.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-27 14:02:09 -08:00
Gyu-Ho Lee 5a154e8e2b *: disable gRPC client logs in tests
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-11 20:56:00 -08:00
Gyu-Ho Lee 123b869a0f clientv3/integration: match grpc.ErrClientConnClosing in TestKVNewAfterClose
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-10 15:39:35 -08:00
Gyu-Ho Lee 52f4bc9061 clientv3/integration: remove TestKVGetOneEndpointDown
Already tested in other server shutdown tests.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-10 14:46:40 -08:00