Skip to content

test(nodes): give the DistributedBackendManager fixtures a system state - #12877

Merged
mudler merged 1 commit into
masterfrom
fix/nodes-test-system-state
Oct 24, 2026
Merged

mudler merged 1 commit into
masterfrom
fix/nodes-test-system-state

Conversation

@mudler-agent

Copy link
Copy Markdown
Collaborator

The core/services/nodes suite panics on master in 23 DistributedBackendManager specs, so the Linux tests job fails.

#12754 (--disable-backend-install) made InstallBackend and UpgradeBackend read d.systemState.DisableBackendInstall. The test fixtures build the manager without a system state, so systemState is nil and every install and upgrade spec dereferences it.

This PR gives each fixture a zero-value system.SystemState, which keeps installs allowed. The fixtures are:

  • managers_distributed_test.go: the outer BeforeEach, and the OpStatus context, which builds the manager through NewDistributedBackendManager with an empty ApplicationConfig.
  • managers_agent_node_test.go
  • noroute_reactions_test.go

No production code changes.

Verification

  • Run locally with the Postgres test container replaced by an in-memory SQLite database (not committed), the suite went from 23 panics to 0 panics. The remaining SQLite-only failures are Postgres-specific SQL, such as now() and interval syntax, and are not related to this change.
  • gofmt -l is clean.
  • The Postgres-backed run is left to CI.

🤖 Generated with Claude Code

The disable-backend-install switch (#12754) makes InstallBackend and
UpgradeBackend read d.systemState.DisableBackendInstall. The test
fixtures build the manager as a struct literal or through
NewDistributedBackendManager with an empty ApplicationConfig, so
systemState is nil and every install and upgrade spec panics with a nil
pointer dereference.

Set a zero-value SystemState in each fixture. That keeps installs
allowed, which is what these specs expect.

Assisted-by: Claude Code:claude-haiku-5-5
@mudler
mudler merged commit 840fa3c into master Oct 24, 2026
70 of 71 checks passed
@mudler
mudler deleted the fix/nodes-test-system-state branch October 24, 2026 13:34
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.

2 participants