Commit Graph

53 Commits (0461b3fa51ebcd3f72ef54296638ac2f19ea9071)

Author SHA1 Message Date
lzhfromustc 1f8764be3b integration: prevent goroutines leaks in test (#11318)
Some goroutines in test functions will be leaked in certain cases.
This patch stops these leaks no matter what happens in test, by
putting the blocking channel in select together with a new stopc
channel, or adding 1 buffer to the blocking channel.
2019-12-05 15:40:10 -08:00
Jingyi Hu fe86a786a4
Merge pull request #10904 from yuzeming/fixed-10899
integration: fix a data race about `i` and `tt` in TestV3WatchFromCur…
2019-07-19 17:51:21 -07:00
Zeming YU 5f21b557e5 integration: fix a data race about `i` and `tt` in TestV3WatchFromCurrentRevision
don't references to loop variables from within go anonymous function

Fixes etcd-io#10899
2019-07-19 00:48:49 -07:00
yzm 3737979532 move wg.Wait() after loop 2019-07-17 16:31:48 -07:00
yzm d87bd2c87c integration: add WaitGroup to prevent calling t.Fatalf after TestV3WatchCurrentPutOverlap function return
It could cause a panic when it happens

Fixes #10886
2019-07-16 10:25:35 -07: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
Gyuho Lee 34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
Gyuho Lee d37f1521b7 *: update import paths to "go.etcd.io/etcd"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 17:47:55 -07:00
Gyuho Lee 9cac286830 integration: move "TestV3WatchRestoreSnapshotUnsync"
When run with "-tags cluster_proxy", panic.
Need investigate more.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-23 15:35:59 -07:00
Gyuho Lee 2847232096 integration: test watch restore on slow follower
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-18 15:19:37 -07: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 80d15948bc *: move "mvcc" to "internal/mvcc"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-26 11:14:41 -08:00
Gyu-Ho Lee f65aee0759 *: replace 'golang.org/x/net/context' with 'context'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-07 13:39:42 -07:00
Hitoshi Mitake 3fefac17b2 integration: clean up resources in error paths of TestV3WatchFromCurrentRevision
Current error paths of TestV3WatchFromCurrentRevision don't clean the
used resources including goroutines. Because go's tests are executed
continuously in a single process, the leaked goroutines makes error
logs bloated like the below case:
https://jenkins-etcd-public.prod.coreos.systems/job/etcd-coverage/2143/

This commit lets the error paths clean the resources.
2017-08-28 16:31:36 +09:00
Anthony Romano 75441390b6 integration: defer clus.Terminate in watch tests
Common pattern was defer cancel(), but clus.Terminate() at the end of
the test. This appears to lead to a deadlock that is only released
once the context times out, causing inflated test times.
2016-12-30 12:34:04 -08:00
Gyu-Ho Lee f3cb93015c integration: simplify boolean comparison in resp.Created 2016-12-12 10:07:14 -08:00
Anthony Romano 76bb33781f integration: cancel Watch when TestV3WatchWithPrevKV exits
Missing ctx cancel was causing goroutine leaks for the proxy tests.
2016-12-01 15:08:18 -08:00
Anthony Romano 6d9168a2ec integration: don't expect recv to stop on CloseSend in waitResponse 2016-11-18 11:37:35 -08:00
Gyu-Ho Lee 396a71ee9e integration: test wrong watcher range 2016-11-08 17:02:32 -08:00
Hongchao Deng c3948284a0 integration: add TestV3WatchWithPrevKV 2016-10-12 16:21:52 -07:00
Anthony Romano 15aa64eb3c Merge pull request #6009 from heyitsanthony/fix-progress-notify
v3rpc: don't elide next progress notification on progress notification
2016-07-20 13:46:11 -07:00
Anthony Romano 8c8742f43c integration: change timeouts for TestWatchWithProgressNotify
a) 2 * progress interval was passing with dropped notifies
b) waitResponse was waiting so long that it expected a dropped notify
2016-07-20 13:23:44 -07:00
Anthony Romano 82ddeb38b4 integration: fix race in TestV3WatchMultipleEventsTxnSynced
Writes between watcher creation request and reply were being dropped.

Fixes #5789
2016-07-20 09:55:39 -07:00
Xiang Li dced92f8bd *: support watch with filters
Now user can filter events with types. The API is also extensible.
It might make sense for the proxy to filter out events based on
more expensive/customized filter.
2016-06-28 13:46:57 -07:00
Anthony Romano 7abc8f21eb integration: update tests for new grpc reconnection interface 2016-06-08 01:04:59 -07:00
Gyu-Ho Lee 1610391449 *: following changes for proto update 2016-06-07 13:33:03 -07:00
Anthony Romano 41d3cea9b3 integration: test closing stream while creating watchers 2016-05-31 11:02:15 -07:00
Gyu-Ho Lee ef44f71da9 *: update LICENSE header 2016-05-12 20:51:48 -07:00
Anthony Romano b7ac758969 *: rename storage package to mvcc 2016-04-25 15:25:51 -07:00
Gyu-Ho Lee 9108af9046 *: clean up from go vet, misspell 2016-04-10 23:16:56 -07:00
Hitoshi Mitake 88306c9fa7 etcdserver, clientv3: let progressReportIntervalMilliseconds be private
progressReportIntervalMilliseconds (old
ProgressReportIntervalMilliseconds) is accessed by multiple goroutines
and it is reported as race.

For avoiding this report, this commit wraps the variable with
functions. They access the variable with atomic operations so the race
won't be reported.
2016-04-05 09:12:17 +09:00
Gyu-Ho Lee b0cc0e443c *: clean up if, bool comparison 2016-04-02 12:55:11 -07:00
Anthony Romano 91dc6b29a6 clientv3/integration: fix race when setting progress report interval 2016-03-28 16:08:18 -07:00
Anthony Romano bd832e5b0a *: migrate Godeps to vendor/ 2016-03-22 17:10:28 -07:00
Gyu-Ho Lee dae7e009b0 *: godoc clean up 2016-03-19 14:19:23 -07:00
Xiang Li 39d307572e integration: fix TestV3WatchFutureRevision
Fix https://github.com/coreos/etcd/issues/4730.

Previously we put keys async and there might be a race when
the watch triggers before the put receives the response. When that
happens, put might fails to get the response since we shutdown the server
when watch triggers.
2016-03-09 09:55:52 -08:00
Xiang Li 036ed87c6d *: support watch from future revision 2016-03-07 10:57:30 -08:00
Anthony Romano a31f84121b Merge pull request #4699 from heyitsanthony/fix-barrier
storage: use creation revision to compute txn event types
2016-03-05 19:17:56 -08:00
Anthony Romano 713f7c056f storage: use creation revision to compute txn event types
Fixes #4688
2016-03-05 19:03:07 -08:00
Xiang Li 633a0bdf55 integration: add test for full range watching 2016-03-05 18:52:41 -08:00
Xiang Li b1521570b6 v3api: support progress 2016-03-03 13:58:15 -08:00
Anthony Romano 8dbc6cfd43 etcdserver: ranges in watcher rpc protocol
protocol change so watch requests are ranges; server rejects non-prefix ranges
2016-02-29 14:03:27 -08:00
Anthony Romano 4fb25d5f0e Merge pull request #4613 from heyitsanthony/clientv3-composite
clientv3: compose API interfaces into client struct
2016-02-29 11:23:34 -08:00
Gyu-Ho Lee 4a0a83380e *: return -1 for canceled watch request 2016-02-26 14:26:46 -08:00
Anthony Romano 5f62c05a6d clientv3: compose all clientv3 APIs into client struct 2016-02-25 18:13:26 -08:00
Gyu-Ho Lee a78604dacb *: watch true cancel, created for wrong rev
This sets Created and Cancel true in pb.WatchResponse
when it has received wrong start revision instead of
panic. So that clientv3 can set 'Canceled' in WatchResponse
as well.

Fix https://github.com/coreos/etcd/issues/4610.
2016-02-24 20:56:17 -08:00
Anthony Romano 270fa00e54 integration: fix go vet -shadow error
breaking go tip
2016-02-18 12:26:35 -08:00
Anthony Romano 155412bbfa integration: overlapped create and put v3 watcher test 2016-02-17 14:03:52 -08:00
Anthony Romano 019a145304 integration: put keys after watcher ack in TestV3WatchFromCurrentRevision
Watcher would miss events since the keys would be created after
sending the watcher request but before etcd registered the watcher.
2016-02-17 01:06:52 -08:00