fix(sui,aptos): skip tarring cwd when ContractsDir is empty#2519
Merged
Conversation
newSui and newAptos unconditionally called filepath.Abs(in.ContractsDir)
and added the result as a testcontainers ContainerFile. When the caller
leaves ContractsDir empty, filepath.Abs("") resolves to the process
working directory, causing testcontainers-go to tar the entire cwd via
archive/tar and copy it into the container.
In integration-tests the cwd is a live test working directory (logs,
db dumps, artifact collectors). Any file that grows between
tar.FileInfoHeader's stat-derived size and the subsequent io.Copy trips
the stdlib tar writer's ErrWriteTooLong guard, which testcontainers
surfaces as:
create container: created hook: can't copy <cwd> to container:
error compressing file: archive/tar: write too long
This manifests as a Sui CCIP smoke-test flake in downstream consumers
(chainlink CCIP in-memory tests), typically hidden by the provider's
retry loop but occasionally exhausting retries and always adding noise.
Gate the ContainerFile entry on a non-empty ContractsDir. Callers that
explicitly pass a directory continue to get the prior copy-to-container
behaviour; callers that need no host files no longer tar a busy cwd.
Fletch153
added a commit
to smartcontractkit/chainlink
that referenced
this pull request
Apr 14, 2026
Bumps github.com/smartcontractkit/chainlink-testing-framework/framework
across all repo modules to pull in the upstream fix that gates the
testcontainers ContainerFile entry on a non-empty ContractsDir.
Previously, Sui and Aptos blockchain providers in the framework called
filepath.Abs(in.ContractsDir) and unconditionally added a Files entry
to the container request. Because filepath.Abs("") resolves to cwd,
testcontainers-go tarred the entire test working directory. Any file
that grew between os.Stat (header size) and io.Copy (body) tripped
archive/tar's ErrWriteTooLong guard, surfacing in CCIP Sui smoke tests
as:
ctf_provider.go:230: Attempt 1/10: Failed to start CTF Sui container:
create container: created hook: can't copy ... to container:
error compressing file: archive/tar: write too long
The retry loop (10 attempts, 1s) usually masked the flake but
intermittently exhausted, hard-failing tests like
Test_CCIPTokenTransfer_Sui2EVM_BurnMintTokenPool_WithAllowlist.
Upstream fix: smartcontractkit/chainlink-testing-framework#2519
4 tasks
Same logical change (gate Files on ContractsDir != ""), restructured to reduce diff noise: compute files slice before req literal, assign via Files: files — req struct keeps original field order, trailing commas, and WaitingFor placement untouched.
Fletch153
added a commit
to smartcontractkit/chainlink
that referenced
this pull request
Apr 14, 2026
Picks up smartcontractkit/chainlink-testing-framework#2519 refactor commit (14664092839c) — same behavioural fix, minimized diff.
Tofel
approved these changes
Apr 14, 2026
Fletch153
added a commit
to smartcontractkit/chainlink-aptos
that referenced
this pull request
Apr 14, 2026
… race Picks up smartcontractkit/chainlink-testing-framework#2519 — the Aptos CTF provider in chainlink-deployments-framework builds blockchain.Input with no ContractsDir, causing CTF's newAptos to filepath.Abs("") = cwd and tar-stream the live test working directory via testcontainers-go. Growing log files trip archive/tar: write too long intermittently. This bump lands the upstream guard for the Aptos path (identical shape to the Sui fix). No behaviour change for callers passing an explicit ContractsDir. Unsigned — will sign before ready-for-review.
Merged
2 tasks
Fletch153
added a commit
to smartcontractkit/chainlink-deployments-framework
that referenced
this pull request
Apr 14, 2026
Pulls in smartcontractkit/chainlink-testing-framework#2519. The Sui and Aptos CTF providers in chain/{sui,aptos}/provider/ctf_provider.go build blockchain.Input with no ContractsDir, which made upstream newSui/newAptos call filepath.Abs("") = cwd and tar-stream the live test working directory. Growing files trip archive/tar: write too long intermittently, surfacing as retries (mostly masked by the retry.Attempts(10) loop) in Test_CTFChainProvider_Initialize. Module bump only — no source changes. Patch-level release. Unsigned — will sign before ready-for-review.
3 tasks
Fletch153
added a commit
to smartcontractkit/chainlink
that referenced
this pull request
Apr 14, 2026
Pulls in smartcontractkit/chainlink-testing-framework#2519 — the Sui/Aptos CTF provider cwd tar-race fix. Eliminates intermittent 'archive/tar: write too long' flakes in Sui CCIP smoke tests. Tidied go.sum across all 8 modules.
Fletch153
added a commit
to smartcontractkit/chainlink-aptos
that referenced
this pull request
Apr 14, 2026
Pulls in smartcontractkit/chainlink-testing-framework#2519 — the Sui/Aptos CTF provider cwd tar-race fix. The Aptos provider in chainlink-deployments-framework builds blockchain.Input with no ContractsDir, causing upstream newAptos to filepath.Abs("") = cwd and tar-stream the live test working directory. Growing log files trip archive/tar: write too long intermittently. Module bump only — no source changes.
Fletch153
added a commit
to smartcontractkit/chainlink-deployments-framework
that referenced
this pull request
Apr 14, 2026
Pulls in smartcontractkit/chainlink-testing-framework#2519. The Sui and Aptos CTF providers in chain/{sui,aptos}/provider/ctf_provider.go build blockchain.Input with no ContractsDir, which made upstream newSui/newAptos call filepath.Abs("") = cwd and tar-stream the live test working directory. Growing files trip archive/tar: write too long intermittently, surfacing as retries in Test_CTFChainProvider_Initialize. Module bump only — no source changes. Patch-level release. Changeset: .changeset/fix-sui-aptos-cwd-tar-race.md
github-merge-queue Bot
pushed a commit
to smartcontractkit/chainlink
that referenced
this pull request
Apr 15, 2026
…ace (#22011) * fix(ctf): bump chainlink-testing-framework to fix Sui/Aptos cwd tar race Bumps github.com/smartcontractkit/chainlink-testing-framework/framework across all repo modules to pull in the upstream fix that gates the testcontainers ContainerFile entry on a non-empty ContractsDir. Previously, Sui and Aptos blockchain providers in the framework called filepath.Abs(in.ContractsDir) and unconditionally added a Files entry to the container request. Because filepath.Abs("") resolves to cwd, testcontainers-go tarred the entire test working directory. Any file that grew between os.Stat (header size) and io.Copy (body) tripped archive/tar's ErrWriteTooLong guard, surfacing in CCIP Sui smoke tests as: ctf_provider.go:230: Attempt 1/10: Failed to start CTF Sui container: create container: created hook: can't copy ... to container: error compressing file: archive/tar: write too long The retry loop (10 attempts, 1s) usually masked the flake but intermittently exhausted, hard-failing tests like Test_CCIPTokenTransfer_Sui2EVM_BurnMintTokenPool_WithAllowlist. Upstream fix: smartcontractkit/chainlink-testing-framework#2519 * chore: bump CTF framework to minimal-diff fix version Picks up smartcontractkit/chainlink-testing-framework#2519 refactor commit (14664092839c) — same behavioural fix, minimized diff. * chore: bump CTF framework to v0.15.16 Pulls in smartcontractkit/chainlink-testing-framework#2519 — the Sui/Aptos CTF provider cwd tar-race fix. Eliminates intermittent 'archive/tar: write too long' flakes in Sui CCIP smoke tests. Tidied go.sum across all 8 modules.
github-merge-queue Bot
pushed a commit
to smartcontractkit/chainlink-deployments-framework
that referenced
this pull request
Apr 15, 2026
## Summary Bumps `github.com/smartcontractkit/chainlink-testing-framework/framework` to `v0.15.16` to pick up the upstream Sui/Aptos CTF provider cwd-tar-race fix. Upstream PR: smartcontractkit/chainlink-testing-framework#2519 (merged as `v0.15.16`). ## Root Cause `chain/sui/provider/ctf_provider.go` and `chain/aptos/provider/ctf_provider.go` both build `blockchain.Input` with no `ContractsDir`. Upstream CTF's `newSui`/`newAptos` called `filepath.Abs(in.ContractsDir)` unconditionally — Go stdlib resolves `filepath.Abs("")` to the process cwd. That cwd was attached as a `testcontainers.ContainerFile`, tarring the host test working directory. Files being written concurrently (logs, db dumps) trip `archive/tar.ErrWriteTooLong` between `os.Stat` (header size) and `io.Copy` (body). The `retry.Attempts(10)` wrapper in `startContainer` masks most occurrences. `Test_CTFChainProvider_Initialize` (which actually starts a container) hits this path in this repo's own CI. ## Fix Module bump only — no source changes. Pins framework to `v0.15.16` (stable tag), which gates the `Files:` entry on `ContractsDir != ""`. Changeset included: `.changeset/fix-sui-aptos-cwd-tar-race.md` (patch). ## Safety - Callers passing a non-empty `ContractsDir`: identical behaviour. - Callers passing empty (both Sui and Aptos providers in this repo): `req.Files` now nil. testcontainers-go's hook iterates `range files` — zero iterations on nil, no-op (verified upstream in `lifecycle.go:151`). - Delta in `framework/components/blockchain/` from previous pin (`v0.15.13`) to `v0.15.16`: 1 unrelated commit (`#2517 update sui version`) + the 2 fix commits. Minimal transitive risk. ## Test plan - [x] `go build ./...` clean - [x] `go mod tidy` clean - [x] CI green — 22 checks pass, 2 skipped, 0 failing
Fletch153
added a commit
to smartcontractkit/chainlink-aptos
that referenced
this pull request
Apr 15, 2026
Pulls in smartcontractkit/chainlink-testing-framework#2519 — the Sui/Aptos CTF provider cwd tar-race fix. The Aptos provider in chainlink-deployments-framework builds blockchain.Input with no ContractsDir, causing upstream newAptos to filepath.Abs("") = cwd and tar-stream the live test working directory. Growing log files trip archive/tar: write too long intermittently. Module bump only — no source changes.
graham-chainlink
pushed a commit
to smartcontractkit/chainlink-deployments-framework
that referenced
this pull request
Apr 16, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to ggoh/test-ci, this PR will be updated. # Releases ## chainlink-deployments-framework@0.95.1 ### Patch Changes - [#929](#929) [`9d78329`](9d78329) Thanks [@Fletch153](https://github.com/Fletch153)! - Bump chainlink-testing-framework/framework to pick up the Sui/Aptos CTF provider cwd-tar-race fix (upstream smartcontractkit/chainlink-testing-framework#2519). Resolves intermittent `archive/tar: write too long` flakes in `Test_CTFChainProvider_Initialize` for the Sui and Aptos providers. ## operations-gen@0.0.2 ### Patch Changes - [`80d3475`](80d3475) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - test --------- Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
graham-chainlink
pushed a commit
to smartcontractkit/chainlink-deployments-framework
that referenced
this pull request
Apr 16, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to ggoh/test-ci, this PR will be updated. # Releases ## chainlink-deployments-framework@0.95.1 ### Patch Changes - [#929](#929) [`9d78329`](9d78329) Thanks [@Fletch153](https://github.com/Fletch153)! - Bump chainlink-testing-framework/framework to pick up the Sui/Aptos CTF provider cwd-tar-race fix (upstream smartcontractkit/chainlink-testing-framework#2519). Resolves intermittent `archive/tar: write too long` flakes in `Test_CTFChainProvider_Initialize` for the Sui and Aptos providers. ## operations-gen@0.0.2 ### Patch Changes - [`dbf0e57`](dbf0e57) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - test --------- Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
graham-chainlink
pushed a commit
to smartcontractkit/chainlink-deployments-framework
that referenced
this pull request
Apr 16, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to ggoh/test-ci, this PR will be updated. # Releases ## chainlink-deployments-framework@0.95.1 ### Patch Changes - [#929](#929) [`9d78329`](9d78329) Thanks [@Fletch153](https://github.com/Fletch153)! - Bump chainlink-testing-framework/framework to pick up the Sui/Aptos CTF provider cwd-tar-race fix (upstream smartcontractkit/chainlink-testing-framework#2519). Resolves intermittent `archive/tar: write too long` flakes in `Test_CTFChainProvider_Initialize` for the Sui and Aptos providers. ## tools/operations-gen@0.0.2 ### Patch Changes - [`dbf0e57`](dbf0e57) Thanks [@graham-chainlink](https://github.com/graham-chainlink)! - test --------- Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
github-merge-queue Bot
pushed a commit
to smartcontractkit/chainlink-deployments-framework
that referenced
this pull request
Apr 16, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## chainlink-deployments-framework@0.95.1 ### Patch Changes - [#929](#929) [`9d78329`](9d78329) Thanks [@Fletch153](https://github.com/Fletch153)! - Bump chainlink-testing-framework/framework to pick up the Sui/Aptos CTF provider cwd-tar-race fix (upstream smartcontractkit/chainlink-testing-framework#2519). Resolves intermittent `archive/tar: write too long` flakes in `Test_CTFChainProvider_Initialize` for the Sui and Aptos providers. - [#938](#938) [`9565eff`](9565eff) Thanks [@AnieeG](https://github.com/AnieeG)! - Fix/update anvil startup to use offical anvil image, adding --no-storage-caching option to start up --------- Co-authored-by: app-token-issuer-engops[bot] <144731339+app-token-issuer-engops[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
newSuiandnewAptosinframework/components/blockchain/unconditionally callfilepath.Abs(in.ContractsDir)and attach the result as atestcontainers.ContainerFile. When the caller leavesContractsDirempty (the common case for chains that do not need host contracts copied in),filepath.Abs("")resolves to the process working directory. testcontainers-go then tars that whole cwd viaarchive/tarto copy into the container.In integration-tests the cwd is a live test working directory — log files, db dumps, artifact collectors — actively being appended to while the container starts. If a file grows between
tar.FileInfoHeader(header size fromos.Stat) and the subsequentio.Copy, stdlib'star.WriterreturnsErrWriteTooLongand testcontainers surfaces:Evidence — real CI failure
chainlink run 24372896623, job 71183740665, test
Test_CCIPTokenTransfer_Sui2EVM_BurnMintTokenPool:Cwd printed (
/home/runner/.../integration-tests/smoke/ccip) matches the predicted race target exactly — that directory is actively written bydeployment/logger.SingleFileLogger(relativelogs/dir,autoFlushWritersyncs on every write) while the container starts.Cause chain (verified link-by-link)
ContractsDir—chainlink-deployments-framework/chain/sui/provider/ctf_provider.go:199-206buildsblockchain.Input{Type: TypeSui, ...}with noContractsDirfield.CTFChainProviderConfigexposes no such knob.filepath.Abs("")= cwd — Go stdlib contract.sui.go:98on main:absPath, err := filepath.Abs(in.ContractsDir).ContainerFile—sui.go:153-158:Files: []ContainerFile{{HostFilePath: absPath, ContainerFilePath: "/"}}, unconditional.lifecycle.go:146-172defaultCopyFileToContainerHookwalksHostFilePath; Go'sarchive/tar.Writer.WritereturnsErrWriteTooLongwhen body bytes exceed headerSize.chainlink-deployments-framework/chain/sui/provider/ctf_provider.go:152,226wrapsNewBlockchainNetworkinretry.Dowithretry.Attempts(10),retry.Delay(1s). Most runs self-heal by attempt 2-3; occasional hard failures exhaust the retry budget.Fix
Gate the
ContainerFileentry onin.ContractsDir != "":Applied to both
sui.goandaptos.go— they share the identical shape and bug. Solana (solana.go) intentionally untouched: every Solana caller setsContractsDirexplicitly (Solana validator requires.soartifacts mounted at boot), so the race path is never exercised there.Safety analysis
ContractsDircallers: identical behaviour, samefilepath.Abs+ContainerFileentry.ContractsDircallers:req.Files = nil. testcontainers-go hook loopsfor _, f := range files— zero iterations on nil, no container-side state change. Verified intestcontainers-go@v0.41.0/lifecycle.go:151.TypeSui/TypeAptoscallers returned 3:chainlink-deployments-frameworkSui provider,chainlink-deployments-frameworkAptos provider,chainlink-aptos/integration-tests/ccip/ccip_deployment_test.go. None pass aContractsDir. The empty path isn't a documented default — the struct comment`toml:"contracts_dir" comment:"Solana's contracts directory"`explicitly scopes the field to Solana. The cwd-tarring was a latent side-effect of reusing the Solana-shaped field for Sui/Aptos, not a feature.newSuirunssui start --force-regenesis --with-faucet(stock validator + faucet),newAptosrunsaptos node run-local-testnet. Neither reads files from/inside the container. Contract publishing happens host-side viasui client publish/aptos move publishover RPC against the running node.Test Plan
go build ./components/blockchain/...cleango vet ./components/blockchain/...cleango build ./...passes inchainlink/deploymentandchainlink/integration-tests. Full chainlink CI pending post-merge bump.Notes
No behaviour change for anyone who was already setting
ContractsDir. Draft until downstream chainlink verification CI confirms zeroarchive/tar: write too longretry lines in Sui CCIP smoke tests.