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) {
|
||||
s := newTestMemoryStorage(withPeers(1))
|
||||
cfg := newTestConfig(1, 10, 1, s)
|
||||
ctx, cancel, n := newNodeTestHarness(t, context.Background(), cfg)
|
||||
ctx, cancel, n := newNodeTestHarness(context.Background(), t, cfg)
|
||||
defer cancel()
|
||||
n.Campaign(ctx)
|
||||
allCommittedEntries := make([]raftpb.Entry, 0)
|
||||
@ -590,7 +590,7 @@ func TestNodeStart(t *testing.T) {
|
||||
MaxInflightMsgs: 256,
|
||||
}
|
||||
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()
|
||||
|
||||
{
|
||||
@ -740,7 +740,7 @@ func TestNodeAdvance(t *testing.T) {
|
||||
MaxSizePerMsg: noLimit,
|
||||
MaxInflightMsgs: 256,
|
||||
}
|
||||
ctx, cancel, n := newNodeTestHarness(t, context.Background(), c)
|
||||
ctx, cancel, n := newNodeTestHarness(context.Background(), t, c)
|
||||
defer cancel()
|
||||
|
||||
n.Campaign(ctx)
|
||||
@ -895,7 +895,7 @@ func TestCommitPagination(t *testing.T) {
|
||||
s := newTestMemoryStorage(withPeers(1))
|
||||
cfg := newTestConfig(1, 10, 1, s)
|
||||
cfg.MaxCommittedSizePerReady = 2048
|
||||
ctx, cancel, n := newNodeTestHarness(t, context.Background(), cfg)
|
||||
ctx, cancel, n := newNodeTestHarness(context.Background(), t, cfg)
|
||||
defer cancel()
|
||||
n.Campaign(ctx)
|
||||
|
||||
|
@ -78,7 +78,7 @@ func (l *nodeTestHarness) Panicf(format string, v ...interface{}) {
|
||||
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,
|
||||
// it's likely that deadlock will occur unless Node behaves exactly as
|
||||
// expected - when you expect a Ready and start waiting on the channel
|
||||
|
Loading…
x
Reference in New Issue
Block a user