Skip to content

Commit

Permalink
integration: add extra timeout for GHA test
Browse files Browse the repository at this point in the history
This test can hit rate-limiting from Github and run long.

Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Dec 6, 2024
1 parent 58b5e6a commit 807585b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ var allTests = []func(t *testing.T, sb integration.Sandbox){
testHostnameSpecifying,
testPushByDigest,
testBasicInlineCacheImportExport,
testBasicGhaCacheImportExport,
testBasicGhaCacheImportExportExtraTimeout,
testExportBusyboxLocal,
testBridgeNetworking,
testCacheMountNoCache,
Expand Down Expand Up @@ -6060,7 +6060,7 @@ func testBasicInlineCacheImportExport(t *testing.T, sb integration.Sandbox) {
require.EqualValues(t, unique, unique3)
}

func testBasicGhaCacheImportExport(t *testing.T, sb integration.Sandbox) {
func testBasicGhaCacheImportExportExtraTimeout(t *testing.T, sb integration.Sandbox) {
workers.CheckFeatureCompat(t, sb,
workers.FeatureCacheExport,
workers.FeatureCacheImport,
Expand Down
6 changes: 5 additions & 1 deletion util/testutil/integration/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ func newSandbox(ctx context.Context, t *testing.T, w Worker, mirror string, mv m
ctx, cancel := context.WithCancelCause(ctx)

go func() {
timeoutContext, cancelTimeout := context.WithTimeoutCause(ctx, maxSandboxTimeout, errors.WithStack(context.DeadlineExceeded))
timeout := maxSandboxTimeout
if strings.Contains(t.Name(), "ExtraTimeout") {
timeout *= 3
}
timeoutContext, cancelTimeout := context.WithTimeoutCause(ctx, timeout, errors.WithStack(context.DeadlineExceeded))
defer cancelTimeout()
<-timeoutContext.Done()
select {
Expand Down

0 comments on commit 807585b

Please sign in to comment.