No test drives the read-model replay end to end: a test's reads reach evoq's default store, not the service's #27

Open
opened 2026-11-24 02:55:40 +00:00 by juno · 0 comments
Member

Purpose (test coverage): the replay that fills the letter read model at every start is exercised by a test, so a defect in it (the wrong store, a gate opened over an empty table) fails a test instead of reaching a review.

The replay added for macula-ci-images#19 has no automated test that drives it end to end. The one that was written for it was dropped because, as far as its author could tell, a test could not start this service's store: mcl_mail_store:ensure/2 reaches reckon_db_sup:start_store, the store logged Retry attempt N for store default_store … no_workers, and reads never completed. The 3,000-letter measurement in the pinned CI image stands in for it, by agreement with the dispatcher.

A later measurement found the log lines naming default_store are not the store's own start: default_store is evoq's .app default store_id, and that default is what the app reads once it is loaded, so a value set before application:ensure_all_started(evoq) is not the one evoq uses. A release boot has config/sys.config.src set it (and a test compares that value with mcl_mail_service:event_store/0's id), which is why the service itself is not affected. The store the service opens is mcl_mail_store, and reads named against it work in the same process that fails against default_store.

What the dropped test covered, and what a test should still cover: one mailbox opened through the real desks (initiate_mailbox_v1, then open_mailbox_v1 — the aggregate refuses a deposit into an initiated-but-unopened mailbox), two letters deposited through maybe_deposit_letter:dispatch, one read-model owner started, and both letters read back, newest first, in one page.

Done when: the replay is exercised end to end by a test in CI — the store started, letters deposited through the real desks, one owner started, and the deposits read back after the gate opens — or a comment here shows why that store cannot be started inside a test, with the measurement's script kept as the standing proof.

Found while measuring the replay for macula-ci-images#19 (PR 26). Refs macula-ci-images#19

Purpose (test coverage): the replay that fills the letter read model at every start is exercised by a test, so a defect in it (the wrong store, a gate opened over an empty table) fails a test instead of reaching a review. The replay added for macula-ci-images#19 has no automated test that drives it end to end. The one that was written for it was dropped because, as far as its author could tell, a test could not start this service's store: `mcl_mail_store:ensure/2` reaches `reckon_db_sup:start_store`, the store logged `Retry attempt N for store default_store … no_workers`, and reads never completed. The 3,000-letter measurement in the pinned CI image stands in for it, by agreement with the dispatcher. A later measurement found the log lines naming `default_store` are not the store's own start: `default_store` is evoq's `.app` default `store_id`, and that default is what the app reads once it is loaded, so a value set before `application:ensure_all_started(evoq)` is not the one evoq uses. A release boot has `config/sys.config.src` set it (and a test compares that value with `mcl_mail_service:event_store/0`'s id), which is why the service itself is not affected. The store the service opens is `mcl_mail_store`, and reads named against it work in the same process that fails against `default_store`. What the dropped test covered, and what a test should still cover: one mailbox opened through the real desks (`initiate_mailbox_v1`, then `open_mailbox_v1` — the aggregate refuses a deposit into an initiated-but-unopened mailbox), two letters deposited through `maybe_deposit_letter:dispatch`, one read-model owner started, and both letters read back, newest first, in one page. Done when: the replay is exercised end to end by a test in CI — the store started, letters deposited through the real desks, one owner started, and the deposits read back after the gate opens — or a comment here shows why that store cannot be started inside a test, with the measurement's script kept as the standing proof. Found while measuring the replay for macula-ci-images#19 (PR 26). Refs macula-ci-images#19
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
macula-services/mcl-mail#27
No description provided.