Skip to content

[DX-3791] devenv tests Docker logs panics scan#22021

Open
Tofel wants to merge 14 commits intodevelopfrom
dx-3791-devenv-panics-scan
Open

[DX-3791] devenv tests Docker logs panics scan#22021
Tofel wants to merge 14 commits intodevelopfrom
dx-3791-devenv-panics-scan

Conversation

@Tofel
Copy link
Copy Markdown
Contributor

@Tofel Tofel commented Apr 15, 2026

Summary

  • Add single-stream Docker log fanout support in framework, so test cleanup consumers read one shared stream instead of opening parallel streams.
  • Introduce stream-injected cleanup consumers in framework (SaveContainerLogsFromStreams, PrintFailedContainerLogsFromStreams), add PrintFailedContainerLogs in framework, and fix SaveContainerLogs shared-slice race.
  • Add CTF convenience APIs in framework (CTFContainersListOpts, CTFContainersLogsOpts, StreamCTFContainerLogsFanout) to reduce callsite boilerplate.
  • Move system-tests failed-log printing to framework delegation (remove duplicated implementation in system-tests/lib/infra/docker.go).
  • Add products.ScanLogsFromStreams and shared products.CleanupContainerLogs(settings) in devenv, then migrate non-functional devenv tests to use this helper (supports per-test scanner exclusions via settings).

Requires:

@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
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 15, 2026

✅ No conflicts with other open PRs targeting develop

@Tofel Tofel force-pushed the dx-3791-devenv-panics-scan branch from cc970ec to 66b8fa7 Compare April 15, 2026 09:59
@trunk-io
Copy link
Copy Markdown

trunk-io bot commented Apr 15, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestConfigureForwarder/set_config_without_mcms The test failed without a clear error message, but it appears to be related to a configuration or registration process in a blockchain or smart con... Logs ↗︎

View Full Report ↗︎Docs

@Tofel Tofel force-pushed the dx-3791-devenv-panics-scan branch from 5b2fcb7 to d4a212a Compare April 16, 2026 11:10
@Tofel Tofel marked this pull request as ready for review April 16, 2026 15:48
@Tofel Tofel requested review from a team as code owners April 16, 2026 15:48
Copilot AI review requested due to automatic review settings April 16, 2026 15:48
@Tofel Tofel requested a review from a team as a code owner April 16, 2026 15:48
mchain0
mchain0 previously approved these changes Apr 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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: MEDIUM — touches shared test harness cleanup behavior, introduces/uses concurrent log-stream processing, and updates a shared testing-framework dependency.

This PR centralizes Docker container log scanning/saving/failed-log printing into the testing framework and devenv/products, then migrates test callsites to use the new helpers to avoid parallel log streams and reduce duplicated cleanup logic.

Changes:

  • Bump chainlink-testing-framework/framework to v0.15.17 across modules (system-tests, devenv, core/scripts).
  • Remove system-tests/lib/infra/docker.go (duplicated log/panic scanning + failed-log printing) and delegate to framework helpers.
  • Add products.ScanLogsFromStreams + products.CleanupContainerLogs(settings) and migrate many devenv tests to use the shared cleanup helper.

Reviewed changes

Copilot reviewed 35 out of 39 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
system-tests/tests/test-helpers/before_suite.go Switches panic/failed-log handling to framework helpers in test cleanup.
system-tests/tests/go.mod Bumps CTF framework dependency to v0.15.17.
system-tests/tests/go.sum Updates sums for CTF framework v0.15.17.
system-tests/lib/infra/docker.go Removes duplicated Docker log printing + panic scanning implementation.
system-tests/lib/go.mod Bumps CTF framework dependency to v0.15.17.
system-tests/lib/go.sum Updates sums for CTF framework v0.15.17.
system-tests/lib/cre/environment/jobs.go Uses framework failed-container log printing on JD start failures.
system-tests/lib/cre/environment/dons.go Uses framework failed-container log printing on DON startup failures.
system-tests/lib/cre/environment/blockchains/blockchains.go Uses framework failed-container log printing on deployer selection errors.
devenv/products/logs.go Adds stream-based log scanning and a consolidated cleanup helper using fanout.
devenv/tests/vrfv2plus/smoke_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2plus/replay_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2plus/pending_block_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2plus/multiple_keys_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2plus/migration_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2plus/bhs_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2plus/bhf_test.go Migrates cleanup and adds per-test allowed-message settings.
devenv/tests/vrfv2plus/batch_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2/smoke_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2/multiple_keys_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2/bhs_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrfv2/batch_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/vrf/smoke_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/ocr2/soak_test.go Switches to log-stream fanout for scanning/panic detection; saves logs on failure.
devenv/tests/ocr2/smoke_test.go Migrates cleanup and adds per-test allowed-message settings.
devenv/tests/ocr2/chaos_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/logpoller/logpoller_test.go Replaces direct scanning with consolidated cleanup helper.
devenv/tests/keepers/smoke_test.go Replaces per-subtest scan+save with consolidated cleanup helper.
devenv/tests/flux/smoke_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/features/reorg_finality_violation_test.go Migrates cleanup and adds per-test allowed-message settings.
devenv/tests/features/jd_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/directrequest/smoke_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/cron/smoke_test.go Migrates cleanup to products.CleanupContainerLogs.
devenv/tests/automation/smoke_test.go Restores full test list and migrates cleanup to consolidated helper.
devenv/tests/automation/load_test.go Uses log-stream fanout for scanning/panic detection; saves logs on failure.
devenv/go.mod Bumps CTF framework dependency to v0.15.17.
devenv/go.sum Updates sums for CTF framework v0.15.17.
core/scripts/go.mod Bumps CTF framework dependency to v0.15.17.
core/scripts/go.sum Updates sums for CTF framework v0.15.17.
Comments suppressed due to low confidence (1)

devenv/products/logs.go:107

  • The goroutine in ScanLogsFromStreams closes over the loop variable stream. In Go, the iteration variable is reused, so multiple goroutines can end up scanning the same (last) stream, causing missed logs and flaky/incorrect scan results. Capture the current stream per-iteration (e.g., assign to a new local or pass it as a parameter to the closure).
	verifyLogsGroup := &errgroup.Group{}
	for _, stream := range logStream {
		verifyLogsGroup.Go(func() error {
			verifyErr := verifyLogStream(
				stream,
				settings.FailingLogLevel,
				settings.Threshold,
				settings.AllowedMessages...,
			)
			// ignore processing errors
			if verifyErr != nil && !strings.Contains(verifyErr.Error(), MultipleLogsAtLogLevelErr) &&
				!strings.Contains(verifyErr.Error(), OneLogAtLogLevelErr) {
				l.Error().Err(verifyErr).Msg("Error processing CL node logs")

				return nil

				// if it's not a processing error, we want to fail the test; we also can stop processing logs all together at this point
			} else if verifyErr != nil &&
				(strings.Contains(verifyErr.Error(), MultipleLogsAtLogLevelErr) ||
					strings.Contains(verifyErr.Error(), OneLogAtLogLevelErr)) {
				return verifyErr
			}
			return nil
		})

Comment thread system-tests/tests/test-helpers/before_suite.go
Comment thread system-tests/lib/cre/environment/dons.go
Comment thread system-tests/tests/test-helpers/before_suite.go
skudasov
skudasov previously approved these changes Apr 16, 2026
@cl-sonarqube-production
Copy link
Copy Markdown

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