aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/command_race_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git/command_race_test.go')
-rw-r--r--modules/git/command_race_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/git/command_race_test.go b/modules/git/command_race_test.go
index f567406822..a6aa3a1580 100644
--- a/modules/git/command_race_test.go
+++ b/modules/git/command_race_test.go
@@ -15,9 +15,9 @@ func TestRunWithContextNoTimeout(t *testing.T) {
maxLoops := 10
// 'git --version' does not block so it must be finished before the timeout triggered.
- cmd := NewCommand(context.Background(), "--version")
+ cmd := NewCommand("--version")
for i := 0; i < maxLoops; i++ {
- if err := cmd.Run(&RunOpts{}); err != nil {
+ if err := cmd.Run(t.Context(), &RunOpts{}); err != nil {
t.Fatal(err)
}
}
@@ -27,9 +27,9 @@ func TestRunWithContextTimeout(t *testing.T) {
maxLoops := 10
// 'git hash-object --stdin' blocks on stdin so we can have the timeout triggered.
- cmd := NewCommand(context.Background(), "hash-object", "--stdin")
+ cmd := NewCommand("hash-object", "--stdin")
for i := 0; i < maxLoops; i++ {
- if err := cmd.Run(&RunOpts{Timeout: 1 * time.Millisecond}); err != nil {
+ if err := cmd.Run(t.Context(), &RunOpts{Timeout: 1 * time.Millisecond}); err != nil {
if err != context.DeadlineExceeded {
t.Fatalf("Testing %d/%d: %v", i, maxLoops, err)
}