integration: use t.Context
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
4 files changed
+4
-5
No files matched your search
@@ -826,7 +826,7 @@ func TestBuildEmitsEvents(t *testing.T) {
|
||||
// Clean up tagged image if we created one
|
||||
if tc.tag != "" {
|
||||
t.Cleanup(func() {
|
||||
if _, err := apiClient.ImageRemove(context.Background(), tc.tag, client.ImageRemoveOptions{Force: true}); err != nil {
|
||||
if _, err := apiClient.ImageRemove(t.Context(), tc.tag, client.ImageRemoveOptions{Force: true}); err != nil {
|
||||
t.Logf("failed to remove image %s: %v", tc.tag, err)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -252,7 +252,7 @@ func TestExecSocketDenied(t *testing.T) {
|
||||
}
|
||||
serverResult := make(chan exchangeResult, 1)
|
||||
go func() {
|
||||
conn, _, err := listener.Accept(context.Background(), 0)
|
||||
conn, _, err := listener.Accept(t.Context(), 0)
|
||||
if err != nil {
|
||||
serverResult <- exchangeResult{err: fmt.Errorf("accept AF_VSOCK connection: %w", err)}
|
||||
return
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package image
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -58,7 +57,7 @@ func TestUsernsCommit(t *testing.T) {
|
||||
|
||||
t.Parallel()
|
||||
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
dUserRemap := daemon.New(t, daemon.WithUserNsRemap("default"))
|
||||
dUserRemap.StartWithBusybox(ctx, t, "--iptables=false", "--ip6tables=false")
|
||||
clientUserRemap := dUserRemap.NewClientT(t)
|
||||
|
||||
@@ -256,7 +256,7 @@ func TestRunMountImage(t *testing.T) {
|
||||
// | |-- bad (symlink to root)
|
||||
func setupTestVolume(t *testing.T, apiClient client.APIClient) string {
|
||||
t.Helper()
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
volumeName := t.Name() + "-volume"
|
||||
|
||||
|
||||
Reference in new issue
Block a user