Skip to content

fix: improve solana speed tests#111

Merged
ecPablo merged 4 commits into
mainfrom
ecpablo/solana-test-speed
Jun 29, 2026
Merged

fix: improve solana speed tests#111
ecPablo merged 4 commits into
mainfrom
ecpablo/solana-test-speed

Conversation

@ecPablo

@ecPablo ecPablo commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Reuse some of the containers to speed up tests for solana

@github-actions

Copy link
Copy Markdown

Release impact (release-please)

Current version 0.7.1 (on main)
After merge 0.7.2 (patch bump)

PR title: fix: improve solana speed tests

Merging this PR as-is will contribute a patch bump to the next release-please release PR.

Conventional commit → bump

Intent PR title prefix Bump
Bug fix fix: patch
New feature feat: minor
Breaking change feat!: / fix!: or BREAKING CHANGE: / BREAKING-CHANGE: in description major
No release chore:, docs:, ci:, refactor:, etc. none

Update the PR title before merge if you need a different bump (squash commit message = PR title).

Preview is based on this PR title only. The release-please release PR may include other unreleased commits already on main.

Cache MCMS program artifacts once per process, fix PreloadMCMS nested-subtest
deadlocks, use a mock env for set-config VerifyPreconditions, and reuse an
existing chain in fund-mcm-pdas instead of starting a second validator.
@ecPablo ecPablo force-pushed the ecpablo/solana-test-speed branch from 63797fa to e07b5ca Compare June 29, 2026 18:06
@ecPablo ecPablo marked this pull request as ready for review June 29, 2026 19:30
@ecPablo ecPablo requested a review from a team as a code owner June 29, 2026 19:30
Comment thread legacy/pkg/family/solana/testutils/preload.go Outdated
@cl-sonarqube-production

Copy link
Copy Markdown

@ecPablo ecPablo requested a review from gustavogama-cll June 29, 2026 21:05
progIDs := loadProgramArtifacts(t,
solutils.MCMSProgramNames, downloadChainlinkCCIPProgramArtifacts, dir,
)
func acquireSolanaTestIsolation(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confess I don't get how this lock works...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's how I'm reading it: it allows the same t instance to call PreloadMCMS multiple times, without locking. Any other calls will wait. Is that the idea? How often do we call PreloadMCMS this way?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more a process wide lock the idea is to mainly serialize the calls to SetProgramID which is what bites us when running these tests with t.Parallel()

Should work something like this:

  1. First, PreloadMCMS() call while solTestDepth == 0 acquires solTestExclusive.
  2. Then Every PreloadMCMS call increments depth and registers a t.Cleanup on that test’s t.
  3. Nested calls see depth > 0, skip re-locking, and only bump depth to deadlock.
  4. Unlock happens only when the outermost cleanup runs (depth back to 0), i.e. when the whole nested stack of tests that called PreloadMCMS has finished.

@ecPablo ecPablo merged commit d52089d into main Jun 29, 2026
17 checks passed
@ecPablo ecPablo deleted the ecpablo/solana-test-speed branch June 29, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants