Symptom

ScreenCoreTest.selectAvatar_marksFlagTrue_andCallsSelectNode failed on CI with an assertion error at line 82. The test verified mgr.selectNode("avatar-install-id") but CI runners have a real ~/.krill/install_id file whose value is never "avatar-install-id".

Root cause

DefaultScreenCore.selectAvatar() called nodeManager.selectNode(installId()) directly. installId() is a platform function that reads from ~/.krill/install_id (or /etc/krill/install_id on server). CI runners run as deployed Krill hosts, so the file exists with a real UUID, not the fixture string the test expected.

Fix

Added installIdProvider: () -> String = installId as a constructor parameter on DefaultScreenCore (defaulting to the real installId so production DI is unchanged). selectAvatar() now calls installIdProvider() instead of installId(). The test’s newCore() passes { "avatar-install-id" } so the fixture is deterministic and environment-independent.

Prevention

Any class that calls installId() in a non-trivial method is a test-flake waiting to happen on the CI runner. The canonical fix is to inject installIdProvider: () -> String = installId and let callers pass a literal in tests — the same pattern used in LocalSwarmHost (selfId: () -> String = installId). When adding a new class that needs the local install ID, check whether its methods will be unit-tested; if yes, wire the provider at construction time rather than calling installId() inline.