Skip to content

test: Memory tests, deterministic test waits, regenerated DocC docs#26

Open
andrej-jasso wants to merge 3 commits into
mainfrom
feature/memory-tests-deterministic-tests-docs
Open

test: Memory tests, deterministic test waits, regenerated DocC docs#26
andrej-jasso wants to merge 3 commits into
mainfrom
feature/memory-tests-deterministic-tests-docs

Conversation

@andrej-jasso

Copy link
Copy Markdown
Collaborator

Summary

  • Memory tests (closes Check for potential memory issues #13): new MemoryTests suite verifying that started reactors, AnyReactor wrappers and their wrapped bases deallocate once the last strong reference is dropped, that subscription tasks are cancelled and subscribers disconnected from publishers on dealloc, and that reactors with in-flight run events deallocate after the event finishes. All pass — no leaks found in these scenarios.
  • Deterministic tests: the start-idempotency and debounce tests no longer rely on fixed Task.sleep delays. They poll for expected state via a new waitUntil helper (fails only after a full timeout, passes as soon as the condition holds) and assert idempotency through synchronously registered subscription counts. The shared ManualEventPublisher singleton was replaced with a per-instance publisher on ObservableModel, removing cross-test coupling.
  • Documentation (issue Finish GoodReactor v2 documentation #4): added the swift-docc-plugin dependency and regenerated the static DocC site in docs/ from current sources, replacing the 2023 pre-v2 site (which still documented GoodCoordinator). The existing README link to GitHub Pages keeps working.

Test plan

  • swift test: 28 tests, 0 failures, verified across repeated runs.

🤖 Generated with Claude Code

andrej-jasso and others added 3 commits July 4, 2026 14:51
Adds MemoryTests verifying that started reactors, AnyReactor wrappers
and their subscriptions deallocate and cancel cleanly. Replaces the
shared ManualEventPublisher singleton with a per-instance publisher on
ObservableModel so tests no longer couple through global state, and
adds a polling waitUntil helper for deterministic asynchronous waits.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rewrites the start-idempotency and debounce tests to poll for the
expected state instead of sleeping for fixed durations, and asserts
idempotency through synchronously registered subscription counts.
Removes flakiness on slow machines while running faster on fast ones.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the swift-docc-plugin dependency and regenerates the static
documentation site in docs/ from the current sources, replacing the
2023 pre-v2 site. Generated with:

swift package --allow-writing-to-directory docs generate-documentation \
  --target GoodReactor --disable-indexing --transform-for-static-hosting \
  --hosting-base-path GoodReactor --output-path docs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

Check for potential memory issues

1 participant