Skip to content

move FinalizeLatest inside the tx sending loop - #22614

Merged
Tofel merged 3 commits into
developfrom
fix-flaky-TestIntegration_Functions_MultipleV1Requests_Success
Jun 10, 2026
Merged

move FinalizeLatest inside the tx sending loop#22614
Tofel merged 3 commits into
developfrom
fix-flaky-TestIntegration_Functions_MultipleV1Requests_Success

Conversation

@Tofel

@Tofel Tofel commented May 22, 2026

Copy link
Copy Markdown
Contributor

commit after each tx to avoid nonce collisions like this one:

Error Trace:	/home/runner/_work/chainlink/chainlink/core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go:619
        	            		/home/runner/_work/chainlink/chainlink/core/services/ocr2/plugins/functions/integration_tests/v1/functions_integration_test.go:50
Error:      	Received unexpected error:
         	    replacement transaction underpriced
Test:       	TestIntegration_Functions_MultipleV1Requests_Success

MQ failure: https://github.com/smartcontractkit/chainlink/actions/runs/26240637562/job/77225788271

@github-actions

Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@trunk-io

trunk-io Bot commented May 22, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@Tofel
Tofel marked this pull request as ready for review May 22, 2026 09:25
@Tofel
Tofel requested a review from a team as a code owner May 22, 2026 09:25
Copilot AI review requested due to automatic review settings May 22, 2026 09:25

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 (changes are confined to integration test utilities, but can impact CI stability/flakiness)

This PR updates the Functions OCR2 v1 integration test utilities to mine/finalize after each request transaction, reducing the likelihood of nonce collisions (e.g., “replacement transaction underpriced”) when sending multiple requests in quick succession.

Changes:

  • Move client.FinalizeLatest(t, b) inside the per-request send loop to commit/finalize after each SendRequest.
  • Rename the loop variable (clientcc) to avoid shadowing the imported client package.
  • Refactor the response-validation goroutine spawning to use wg.Go(...).

Scrupulous human review recommended (high impact on CI behavior):

  • ClientTestRequests request-sending loop (FinalizeLatest placement): verify FinalizeLatest is the correct mechanism to advance nonce state on the backend and doesn’t introduce excessive test runtime.

Comment thread core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go Outdated
Comment thread core/services/ocr2/plugins/functions/integration_tests/v1/internal/testutils.go Outdated
mchain0
mchain0 previously approved these changes May 22, 2026
@cl-sonarqube-production

Copy link
Copy Markdown

@Tofel
Tofel enabled auto-merge June 10, 2026 11:28
@Tofel
Tofel added this pull request to the merge queue Jun 10, 2026
Merged via the queue into develop with commit 8c69c71 Jun 10, 2026
216 of 217 checks passed
@Tofel
Tofel deleted the fix-flaky-TestIntegration_Functions_MultipleV1Requests_Success branch June 10, 2026 16:58
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.

6 participants