mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
move ctx param to the front
to appease linter Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
This commit is contained in:
parent
f62b9d5e19
commit
894e5cb685
@ -317,7 +317,7 @@ func TestNodeProposeConfig(t *testing.T) {
|
|||||||
func TestNodeProposeAddDuplicateNode(t *testing.T) {
|
func TestNodeProposeAddDuplicateNode(t *testing.T) {
|
||||||
s := newTestMemoryStorage(withPeers(1))
|
s := newTestMemoryStorage(withPeers(1))
|
||||||
cfg := newTestConfig(1, 10, 1, s)
|
cfg := newTestConfig(1, 10, 1, s)
|
||||||
ctx, cancel, n := newNodeTestHarness(t, context.Background(), cfg)
|
ctx, cancel, n := newNodeTestHarness(context.Background(), t, cfg)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
n.Campaign(ctx)
|
n.Campaign(ctx)
|
||||||
allCommittedEntries := make([]raftpb.Entry, 0)
|
allCommittedEntries := make([]raftpb.Entry, 0)
|
||||||
@ -590,7 +590,7 @@ func TestNodeStart(t *testing.T) {
|
|||||||
MaxInflightMsgs: 256,
|
MaxInflightMsgs: 256,
|
||||||
}
|
}
|
||||||
n := StartNode(c, []Peer{{ID: 1}})
|
n := StartNode(c, []Peer{{ID: 1}})
|
||||||
ctx, cancel, n := newNodeTestHarness(t, context.Background(), c, Peer{ID: 1})
|
ctx, cancel, n := newNodeTestHarness(context.Background(), t, c, Peer{ID: 1})
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -740,7 +740,7 @@ func TestNodeAdvance(t *testing.T) {
|
|||||||
MaxSizePerMsg: noLimit,
|
MaxSizePerMsg: noLimit,
|
||||||
MaxInflightMsgs: 256,
|
MaxInflightMsgs: 256,
|
||||||
}
|
}
|
||||||
ctx, cancel, n := newNodeTestHarness(t, context.Background(), c)
|
ctx, cancel, n := newNodeTestHarness(context.Background(), t, c)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
n.Campaign(ctx)
|
n.Campaign(ctx)
|
||||||
@ -895,7 +895,7 @@ func TestCommitPagination(t *testing.T) {
|
|||||||
s := newTestMemoryStorage(withPeers(1))
|
s := newTestMemoryStorage(withPeers(1))
|
||||||
cfg := newTestConfig(1, 10, 1, s)
|
cfg := newTestConfig(1, 10, 1, s)
|
||||||
cfg.MaxCommittedSizePerReady = 2048
|
cfg.MaxCommittedSizePerReady = 2048
|
||||||
ctx, cancel, n := newNodeTestHarness(t, context.Background(), cfg)
|
ctx, cancel, n := newNodeTestHarness(context.Background(), t, cfg)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
n.Campaign(ctx)
|
n.Campaign(ctx)
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ func (l *nodeTestHarness) Panicf(format string, v ...interface{}) {
|
|||||||
panic(fmt.Sprintf(format, v...))
|
panic(fmt.Sprintf(format, v...))
|
||||||
}
|
}
|
||||||
|
|
||||||
func newNodeTestHarness(t *testing.T, ctx context.Context, cfg *Config, peers ...Peer) (_ context.Context, cancel func(), _ *nodeTestHarness) {
|
func newNodeTestHarness(ctx context.Context, t *testing.T, cfg *Config, peers ...Peer) (_ context.Context, cancel func(), _ *nodeTestHarness) {
|
||||||
// Wrap context in a 10s timeout to make tests more robust. Otherwise,
|
// Wrap context in a 10s timeout to make tests more robust. Otherwise,
|
||||||
// it's likely that deadlock will occur unless Node behaves exactly as
|
// it's likely that deadlock will occur unless Node behaves exactly as
|
||||||
// expected - when you expect a Ready and start waiting on the channel
|
// expected - when you expect a Ready and start waiting on the channel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user