Skip to content

Commit 9d08d8f

Browse files
authored
Merge pull request #217 from thaJeztah/t_context
reexec: use t.Context()
2 parents 7f6a0a1 + 16149ea commit 9d08d8f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

reexec/reexec_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func TestCommandContext(t *testing.T) {
168168

169169
for _, tc := range tests {
170170
t.Run(tc.doc, func(t *testing.T) {
171-
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
171+
ctx, cancel := context.WithTimeout(t.Context(), 100*time.Millisecond)
172172
defer cancel()
173173

174174
cmd := reexec.CommandContext(ctx, tc.cmdAndArgs...)
@@ -208,7 +208,7 @@ func TestCommandContext(t *testing.T) {
208208
// [reexecoverride.OverrideArgv0] so that the fallback logic is exercised
209209
// consistently across platforms.
210210
func TestRunNaiveSelf(t *testing.T) {
211-
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
211+
ctx, cancel := context.WithTimeout(t.Context(), 100*time.Millisecond)
212212
defer cancel()
213213

214214
// Force Self() to use naiveSelf(os.Args[0]), instead of "/proc/self/exe" on Linux.

0 commit comments

Comments
 (0)