yams/tests/unit/memory_sync
Trevon 5b0985f0a7
fix: Windows and macOS CI failures on experimental (#370)
* test(memory-sync): build the abandoned workspace instead of copying a pinned one

The exclusive-winner scavenge test copied the live workspace to fake an
abandoned one. The live generation is still pinned and holds a
byte-range lock on its lease. On Windows that lock is mandatory, so
std::filesystem::copy failed: "The process cannot access the file
because another process has locked a portion of the file" (CI artifact
for Tests (windows-x86_64), memory_sync). POSIX locks are advisory,
which is why Linux and macOS passed.

The test now creates the abandoned directory with the scratch marker and
a placeholder winners.sqlite, written in binary mode so the marker keeps
its LF. The scavenger checks only names and that they are regular files.

Signed-off-by: trvon <me@trevon.dev>

* fix(graph): keep native Windows paths as one query term

GraphContextService split queries on characters outside [A-Za-z0-9_:./-].
A native Windows path such as C:\Users\RUNNER~1\...\src\shared.cpp
became fragments like "Users" and "AppData", which skipped the
direct path lookup and matched unrelated files. On Windows CI,
graph_services returned two files where one was expected, and returned
results for a scoped query on an outside path. The tokenizer now treats
'\\' and '~' as part of a term.

The test fixture also wrote node keys in native mixed-separator form,
which ingest never stores. writeSource() now returns the generic
(forward-slash) path, as ingest does.

Signed-off-by: trvon <me@trevon.dev>

* fix(cli): compare graph hints against the canonical working directory

search, grep and graph took the working directory from current_path(),
while stored document paths go through weakly_canonical. On Windows the
working directory can keep an 8.3 short name (C:\Users\RUNNER~1), so
every stored path looked like it was outside the project, and hints
became absolute paths with --global. integration_smoke failed 4
assertions in search_graph_ux_smoke on Windows CI because of this.

invocationCwdForCli() returns the working directory through
weakly_canonical, and the three commands use it. On POSIX getcwd
already returns the resolved path, so nothing changes there.

Signed-off-by: trvon <me@trevon.dev>

* ci(test): print test failure reports as UTF-8

report_meson_failures.py crashed with UnicodeEncodeError on the Windows
runner's cp1252 console as soon as a test's output contained non-ASCII
text. The workflow then fell back to meson's last 100 lines, which did
not include the failing assertions. The script now reconfigures stdout
to UTF-8 (errors=replace) when run as a program.

Signed-off-by: trvon <me@trevon.dev>

* test(memory-sync): let every sync cycle run a backfill pass in the convergence test

"Daemon memory sync periodically converges and stops cleanly" waits for
a document, blob, topology node and topology edge to reach the peer
through periodic backfill. Backfill runs at most one 100 ms pass per
5 s, and on the macos-arm64 runner each publish is slow enough that the
topology edge (published last) missed the window. The CI test log shows
CHECK(topologyEdgePublished) false after three passes ("backfill
attempts before=1 after=4") in both failing runs.

The wait loop now expires the backfill schedule on each poll with the
existing test hook, so the real periodic sync callback runs a pass every
cycle and the wait is bounded by publish cost, not by the cadence.

Signed-off-by: trvon <me@trevon.dev>

---------

Signed-off-by: trvon <me@trevon.dev>
2026-10-26 05:53:12 -06:00
..
apply_health_catch2_test.cpp fix(daemon): admit cold reads and preserve sync deferral accounting (#331) 2026-10-22 07:12:25 -06:00
content_blob_sync_catch2_test.cpp feat(memory-sync): apply paged winners through bounded adapters (#330) 2026-10-22 07:12:24 -06:00
memory_sync_catch2_test.cpp fix: Windows and macOS CI failures on experimental (#370) 2026-10-26 05:53:12 -06:00
memory_sync_cli_catch2_test.cpp [10/14] Move large inline implementations into translation units (#150) 2026-09-12 10:09:20 -04:00
memory_sync_config_catch2_test.cpp fix(memory-sync): bound complete sweeps and cancel filesystem walks (#321) 2026-10-18 07:29:13 -06:00
memory_sync_service_catch2_test.cpp feat(memory-sync): add pinned adapter views and callback drains (#329) 2026-10-22 07:12:23 -06:00
records_catch2_test.cpp feat(memory-sync): validate traceable record-only task revisions 2026-09-05 11:52:57 -06:00
version_vector_catch2_test.cpp feat(memory-sync): authenticate records 2026-08-17 20:03:52 -06:00