Repository navigation
beholder: inject emitters in jobspec/node_platform/shell (Phase 1) - #23970
Conversation
|
👋 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! |
|
I see you updated files related to
|
|
✅ No conflicts with other open PRs targeting |
7f0bed2 to
370b06e
Compare
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues were identified.
0 open findings
What changed in this PR
Injects per-test Beholder emitters for jobspec, node-platform, and shell code while preserving production behavior through late-bound global emitters.
Changes:
- Adds configurable emitter injection.
- Replaces global observers with parallel-safe recorders.
- Updates shared dependencies and checksums.
| File | Description |
|---|---|
system-tests/tests/go.sum |
Updates dependency checksums. |
system-tests/tests/go.mod |
Updates dependencies. |
system-tests/lib/go.sum |
Updates dependency checksums. |
system-tests/lib/go.mod |
Updates dependencies. |
integration-tests/load/go.sum |
Updates dependency checksums. |
integration-tests/load/go.mod |
Updates dependencies. |
integration-tests/go.sum |
Updates dependency checksums. |
integration-tests/go.mod |
Updates dependencies. |
go.sum |
Updates dependency checksums. |
go.mod |
Updates shared dependencies. |
deployment/go.sum |
Updates dependency checksums. |
deployment/go.mod |
Updates dependencies. |
core/services/workflows/v2/engine_test.go |
Uses an injected recorder. |
core/services/nodestatusreporter/jobspec/job_spec_reporter_test.go |
Uses per-test recorders. |
core/services/nodestatusreporter/jobspec/events/emit_test.go |
Uses recorder-based assertions. |
core/services/nodestatusreporter/jobspec/cl_job_info_test.go |
Uses recorder-based assertions. |
core/services/chainlink/node_platform.go |
Adds configurable emitters with global fallback. |
core/services/chainlink/node_platform_test.go |
Injects recorders into tests. |
core/services/chainlink/application.go |
Uses the late-bound global emitter. |
core/scripts/go.sum |
Updates dependency checksums. |
core/scripts/go.mod |
Updates dependencies. |
core/cmd/shell_test.go |
Uses an injected recorder. |
core/cmd/shell_local.go |
Resolves the shell-specific emitter. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
5a34ee2 to
b40d33b
Compare
Bump chainlink-common to 3638f2c19d5c (beholder-emitter-injection, chainlink-common#2458), which adds beholder.GlobalEmitter(), beholdertest.NewRecorder, and custmsg.NewLabelerWithEmitter. Production (no behaviour change; defaults now late-bind to the global client at emit time instead of pinning it at construction): - jobspec.NewJobSpecReporter (application.go) takes beholder.GlobalEmitter() instead of beholder.GetEmitter(). - node_platform: both configs gain an Emitter field, defaulted to beholder.GlobalEmitter() in the constructors; the dead in-loop nil-fallbacks are removed. - shell.EmitNodeConfig emits through the shell's own BeholderClient.Emitter when set, else beholder.GlobalEmitter(). Tests: inject a per-test beholdertest.Recorder and t.Parallel() everywhere these components are asserted on: - jobspec (job_spec_reporter_test, events/emit_test, cl_job_info_test) - node_platform_test (7 tests) - TestShell_emitNodeConfig (Shell.BeholderClient wired to a recorder) - TestEngine_Execution (cfg.BeholderEmitter from a recorder-based labeler; requireEventsLabels/requireEventsMessages take a *beholdertest.Recorder) go test -race -count=3 green on the touched packages.
b40d33b to
8757db6
Compare
|




Why
Layer 1 of the beholder emitter-injection stack (DX-5066): jobspec, node_platform, and shell tests asserted on emissions via
beholdertest.NewObserver, which swaps the process-global client and blockst.Parallel(); this PR injects per-testbeholdertest.Recorderemitters instead, with late-binding defaults so production behaviour is unchanged.Notes
Recorder/GlobalEmitter/NewLabelerWithEmitter(go.mod).NewApplicationpassesbeholder.GlobalEmitter()(resolved at emit time) instead of the construction-timebeholder.GetEmitter().TestShell_BeholderLifecyclestill installs a real client globally viainitGlobalsOnceand never restores it; harmless now that no core test asserts on the global.Changes
How emitters resolve after this PR:
NodePlatform*Config.EmitterfieldsEmittertobeholder.GlobalEmitter()at construction; the dead in-loopGetEmitter()fallbacks are deleted.Shell emits through its own client's emitter
beholderEmitter()returns the Shell's configured emitter, elseGlobalEmitter();EmitNodeConfiglabels through it, so multiple Shells in one process no longer share the first one pinned as global.jobspec tests inject a recorder
newTestReporterreturns the service with its recorder;TestEngine_Execution,emit_test.go, andcl_job_info_test.godropNewObserverforNewRecorder+t.Parallel().Merge Danger
Requires
chainlink-common#2458 (
beholdertest.Recorder,beholder.GlobalEmitter,custmsg.NewLabelerWithEmitter)Supports
#23971 · #23972 · #23973 (rest of the DX-5066 beholder stack)
Deployment Validation Steps
Run a node locally with telemetry enabled and confirm node config and job info still reach beholder (collector output, or the debug log
node configuration emitted through beholder).Stack created with GitHub Stacks CLI • Give Feedback 💬