Skip to content

Commit 532bb79

Browse files
committed
refactor: change remaining calls
1 parent 08b46ed commit 532bb79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/git/command_race_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ func TestRunWithContextNoTimeout(t *testing.T) {
1515
maxLoops := 10
1616

1717
// 'git --version' does not block so it must be finished before the timeout triggered.
18-
cmd := NewCommand(t.Context(), "--version")
18+
cmd := NewCommand("--version")
1919
for i := 0; i < maxLoops; i++ {
20-
if err := cmd.Run(&RunOpts{}); err != nil {
20+
if err := cmd.Run(t.Context(), &RunOpts{}); err != nil {
2121
t.Fatal(err)
2222
}
2323
}
@@ -27,9 +27,9 @@ func TestRunWithContextTimeout(t *testing.T) {
2727
maxLoops := 10
2828

2929
// 'git hash-object --stdin' blocks on stdin so we can have the timeout triggered.
30-
cmd := NewCommand(t.Context(), "hash-object", "--stdin")
30+
cmd := NewCommand("hash-object", "--stdin")
3131
for i := 0; i < maxLoops; i++ {
32-
if err := cmd.Run(&RunOpts{Timeout: 1 * time.Millisecond}); err != nil {
32+
if err := cmd.Run(t.Context(), &RunOpts{Timeout: 1 * time.Millisecond}); err != nil {
3333
if err != context.DeadlineExceeded {
3434
t.Fatalf("Testing %d/%d: %v", i, maxLoops, err)
3535
}

0 commit comments

Comments
 (0)