[DX-3791] devenv tests Docker logs panics scan#22021
Conversation
|
I see you updated files related to
|
|
✅ No conflicts with other open PRs targeting |
cc970ec to
66b8fa7
Compare
|
5b2fcb7 to
d4a212a
Compare
There was a problem hiding this comment.
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/frameworktov0.15.17across 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 manydevenvtests 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
ScanLogsFromStreamscloses over the loop variablestream. 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 currentstreamper-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
})
|




Summary
SaveContainerLogsFromStreams,PrintFailedContainerLogsFromStreams), addPrintFailedContainerLogsin framework, and fixSaveContainerLogsshared-slice race.CTFContainersListOpts,CTFContainersLogsOpts,StreamCTFContainerLogsFanout) to reduce callsite boilerplate.system-testsfailed-log printing to framework delegation (remove duplicated implementation insystem-tests/lib/infra/docker.go).products.ScanLogsFromStreamsand sharedproducts.CleanupContainerLogs(settings)indevenv, then migrate non-functionaldevenvtests to use this helper (supports per-test scanner exclusions via settings).Requires: