Skip to content

[Bug]: macOS ConfigStore test counts unrelated notifications #103477

Description

@steipete

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The macOS ConfigStoreTests notification assertions intermittently count unrelated same-name notifications from other concurrently running app tests, causing the full Swift suite to fail once and pass on retry.

Steps to reproduce

  1. Run the full macOS Swift suite on main after fix(macos): harden fresh AI onboarding #102637 with Swift Testing suites executing concurrently.
  2. Let save routes to remote in remote mode register its .openclawConfigDidChange observer with object: nil.
  3. Allow another owner such as AppState to publish the same notification name before the assertion.
  4. Observe changeCount become 2 although ConfigStore.save posted once.

This occurred in exact-head CI run 29073655164, macos-swift job 86300486692, attempt 1.

Expected behavior

The test counts only the notification emitted by the ConfigStore.save operation under test, while app-wide production listeners continue receiving all config-change senders.

Actual behavior

The observer passes object: nil, which Foundation defines as receiving the notification name from any sender. AppState and ConfigStore both publish .openclawConfigDidChange, so parallel suite activity can increment the test counter twice.

OpenClaw version

Unreleased main after a789b92 (#102637)

Operating system

GitHub macOS arm64 runner; target platform arm64e-apple-macos14.0

Install method

Source checkout / GitHub Actions

Model

N/A - macOS Swift test isolation

Provider / routing chain

N/A - macOS Swift test isolation

Additional provider/model setup details

N/A

Logs

Test "save routes to remote in remote mode" recorded an issue at ConfigStoreTests.swift:60:9:
Expectation failed: (changeCount.value -> 2) == 1
swift test failed (attempt 1/3). Retrying...
Test run with 780 tests in 123 suites passed after 5.852 seconds.

Screenshots, recordings, and evidence

Impact and severity

  • Affected: macOS CI and release validation.
  • Severity: medium; product behavior is intact, but the suite reports a false failure and relies on retry masking.
  • Frequency: timing-dependent when another config-change producer overlaps the observer lifetime.
  • Consequence: noisy release gates, slower CI, and reduced confidence in real macOS failures.

Additional information

The ambiguous notification assertions were introduced by #102637 and are not in a tagged release. A bounded fix can give ConfigStore a stable notification sender and filter only the focused tests by that sender; existing app-wide observers use nil and continue receiving all config changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmaintainerMaintainer-authored PR

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions