Skip to content

Adding fix-flaky-go-test skill - #22010

Closed
kalverra wants to merge 2 commits into
developfrom
fixFlakyTestsSkill
Closed

Adding fix-flaky-go-test skill#22010
kalverra wants to merge 2 commits into
developfrom
fixFlakyTestsSkill

Conversation

@kalverra

@kalverra kalverra commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

This pull request adds comprehensive documentation for the fix-flaky-go-test skill, which provides step-by-step guidance and best practices for identifying, reproducing, and fixing flaky Go tests in the Chainlink codebase. The documentation covers how to leverage Trunk.io for flake tracking and AI-assisted fixes, environment setup, classification of test types, workflow for reproducing and fixing flakes, common root causes, and recommended fix patterns.

Key documentation and process improvements:

Trunk.io integration and flake tracking:

  • Explains how to use Trunk.io to track flaky test history, analyze failure rates, and obtain AI-generated root cause analysis and fix recommendations. Includes instructions for extracting Trunk test links from Jira and using Trunk MCP tools.

Test environment setup and classification:

  • Details environment preparation steps, including database setup and required environment variables, and clarifies how to classify tests by tags such as integration, dev, or trace.

Reproduction and debugging workflow:

  • Provides a structured workflow for reliably reproducing flaky tests, including commands for running tests with various flags (-count, -shuffle, -race, etc.), and advice for narrowing down failure cases.

Root cause analysis and fix patterns:

  • Lists common root causes of flakiness in Go and Chainlink-specific tests, and recommends best

@kalverra
kalverra requested a review from a team as a code owner April 14, 2026 16:17
Copilot AI review requested due to automatic review settings April 14, 2026 16:17
@kalverra
kalverra requested a review from a team as a code owner April 14, 2026 16:17
@github-actions

Copy link
Copy Markdown
Contributor

👋 kalverra, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@kalverra kalverra changed the title Adds a fix-flaky-go-test agent skill [DX-3769] Adds a fix-flaky-go-test agent skill Apr 14, 2026
@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

Copilot AI left a comment

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.

Pull request overview

Risk Rating: LOW — documentation-only change, but it directly guides automated workflows so correctness matters.

Adds a Chainlink-specific fix-flaky-go-test agent skill with repo-specific reproduction and fixing guidance for intermittent Go test failures.

Changes:

  • Introduces a new .agents/skills/fix-flaky-go-test/SKILL.md describing setup, reproduction steps, common root causes, and fix patterns.
  • Aligns the guidance with Chainlink CI tooling (tools/bin/*) and database setup (.dbenv, make testdb).
  • Documents optional CI parity knobs (e.g., GODEBUG=goindex=0) and race/stress testing workflows.

Comment on lines +38 to +41
Append --tags integration to every go test below if the file has //go:build integration.
deployment/ CCIP: use tools/bin/go_core_ccip_deployment_tests pattern (cd deployment, CL_RESERVE_PORTS=128).
Optional CI parity: GODEBUG=goindex=0 on go test (see ci-core.yml).
If the file uses //go:build dev or trace, add matching --tags when reproducing.

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

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

go test uses the -tags flag (e.g., -tags=integration), not --tags. As written, --tags integration will be rejected by go test and would break the reproduction instructions (and any agent automation relying on them).

Suggested change
Append --tags integration to every go test below if the file has //go:build integration.
deployment/ CCIP: use tools/bin/go_core_ccip_deployment_tests pattern (cd deployment, CL_RESERVE_PORTS=128).
Optional CI parity: GODEBUG=goindex=0 on go test (see ci-core.yml).
If the file uses //go:build dev or trace, add matching --tags when reproducing.
Append -tags integration to every go test below if the file has //go:build integration.
deployment/ CCIP: use tools/bin/go_core_ccip_deployment_tests pattern (cd deployment, CL_RESERVE_PORTS=128).
Optional CI parity: GODEBUG=goindex=0 on go test (see ci-core.yml).
If the file uses //go:build dev or trace, add matching -tags when reproducing.

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +94
<verify>
Write the exact repro go test line including -run and --tags integration when relevant.
Race: GORACE log_path, go test -race -shuffle on, confirm no race.* or document skip.

Copilot AI Apr 14, 2026

Copy link

Choose a reason for hiding this comment

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

This section again references --tags integration, but go test expects -tags (e.g., -tags=integration). Please update the example wording so users copy/pasting the repro line don’t get an "unknown flag: --tags" error.

Copilot uses AI. Check for mistakes.
@trunk-io

trunk-io Bot commented Apr 14, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

mchain0
mchain0 previously approved these changes Apr 15, 2026
@sebawo
sebawo requested review from a team as code owners April 15, 2026 16:37
@sebawo sebawo changed the title [DX-3769] Adds a fix-flaky-go-test agent skill fix(ccip): remove unnecessary Solana Docker setup from empty-config flaky test [CCIP-10960] Apr 15, 2026
@github-actions

github-actions Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

CORA - Analysis Skipped

Reason: The number of code owners (2) is less than the minimum required (5) and/or the number of CODEOWNERS entries with changed files (1) is less than the minimum required (2).

Documents how to:
- extract the Trunk test case link from Jira tickets via atlassian MCP
- fetch failure history and rate from the Trunk test page (Scrapling)
- call the Trunk fix-flaky-test MCP tool with the correct fix/investigation ID
  (distinct from the test-case UUID in the page URL)
- distinguish "investigation not found" from a real result

Also adds Docker/Solana sync.Once root cause pattern from CCIP-10960.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Made-with: Cursor
@sebawo
sebawo force-pushed the fixFlakyTestsSkill branch from 526e5e5 to f5d27be Compare April 15, 2026 18:12
@cl-sonarqube-production

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@sebawo sebawo changed the title fix(ccip): remove unnecessary Solana Docker setup from empty-config flaky test [CCIP-10960] Adding fix-flaky-go-test skill Apr 16, 2026
@sebawo

sebawo commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

@kalverra what is required to merge this change?

@kalverra kalverra closed this Apr 22, 2026
@kalverra
kalverra deleted the fixFlakyTestsSkill branch April 22, 2026 14:20
@kalverra

Copy link
Copy Markdown
Collaborator Author

Closed in favor of the superior successor: #22125

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.

4 participants