Skip to content

Commit

Permalink
test/client: Close buildkit client
Browse files Browse the repository at this point in the history
This fixes hang in these tests which caused a timeout.

Signed-off-by: Paweł Gronowski <[email protected]>
(cherry picked from commit 3b0aa69)
  • Loading branch information
vvoland committed Feb 28, 2023
1 parent 0df0faa commit e344f3a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7160,11 +7160,13 @@ func testExportAttestations(t *testing.T, sb integration.Sandbox) {
requiresLinux(t)
c, err := New(sb.Context(), sb.Address())
require.NoError(t, err)
defer c.Close()

registry, err := sb.NewRegistry()
if errors.Is(err, integration.ErrRequirements) {
t.Skip(err.Error())
}
require.NoError(t, err)

ps := []ocispecs.Platform{
platforms.MustParse("linux/amd64"),
Expand Down Expand Up @@ -7480,11 +7482,13 @@ func testAttestationDefaultSubject(t *testing.T, sb integration.Sandbox) {
requiresLinux(t)
c, err := New(sb.Context(), sb.Address())
require.NoError(t, err)
defer c.Close()

registry, err := sb.NewRegistry()
if errors.Is(err, integration.ErrRequirements) {
t.Skip(err.Error())
}
require.NoError(t, err)

ps := []ocispecs.Platform{
platforms.MustParse("linux/amd64"),
Expand Down Expand Up @@ -7617,11 +7621,13 @@ func testAttestationBundle(t *testing.T, sb integration.Sandbox) {
requiresLinux(t)
c, err := New(sb.Context(), sb.Address())
require.NoError(t, err)
defer c.Close()

registry, err := sb.NewRegistry()
if errors.Is(err, integration.ErrRequirements) {
t.Skip(err.Error())
}
require.NoError(t, err)

ps := []ocispecs.Platform{
platforms.MustParse("linux/amd64"),
Expand Down Expand Up @@ -7766,11 +7772,13 @@ func testSBOMScan(t *testing.T, sb integration.Sandbox) {
requiresLinux(t)
c, err := New(sb.Context(), sb.Address())
require.NoError(t, err)
defer c.Close()

registry, err := sb.NewRegistry()
if errors.Is(err, integration.ErrRequirements) {
t.Skip(err.Error())
}
require.NoError(t, err)

p := platforms.MustParse("linux/amd64")
pk := platforms.Format(p)
Expand Down Expand Up @@ -8042,11 +8050,13 @@ func testSBOMScanSingleRef(t *testing.T, sb integration.Sandbox) {
requiresLinux(t)
c, err := New(sb.Context(), sb.Address())
require.NoError(t, err)
defer c.Close()

registry, err := sb.NewRegistry()
if errors.Is(err, integration.ErrRequirements) {
t.Skip(err.Error())
}
require.NoError(t, err)

p := platforms.DefaultSpec()
pk := platforms.Format(p)
Expand Down Expand Up @@ -8206,11 +8216,13 @@ func testSBOMSupplements(t *testing.T, sb integration.Sandbox) {
requiresLinux(t)
c, err := New(sb.Context(), sb.Address())
require.NoError(t, err)
defer c.Close()

registry, err := sb.NewRegistry()
if errors.Is(err, integration.ErrRequirements) {
t.Skip(err.Error())
}
require.NoError(t, err)

p := platforms.MustParse("linux/amd64")
pk := platforms.Format(p)
Expand Down

0 comments on commit e344f3a

Please sign in to comment.