move ctx param to the front

to appease linter

Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
This commit is contained in:
Tobias Grieger 2022-09-07 08:59:36 +02:00
parent f62b9d5e19
commit 894e5cb685
2 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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