Repository navigation
Tests: journal replays reproduce File Info's dates; the MCP connect test holds its own port - #91
Merged
Merged
Conversation
File Info's dates come from the clock, so documents made or saved a second apart differed: journal_replay_reproduces_document and rich_fixture_satisfies_invariants_and_undoes_to_blank failed at random. One approach for every clock-derived date: it is a command input that defaults to now, and the journal records the value used. - file.new takes created? and document.save / file.saveAs take modified? (Unix seconds, or null for none; default now), through date_param / clock_date on the one save path (save_with), so Save, Save As and the UI's save stamp alike; Save a Copy still leaves the dates. - Their journal entries always record the date used, so replaying the journal makes the same document whenever it runs. Actions recorded from the journal (Session::journal_for_action) leave those dates out, so playing an action later dates the document then. - Test fixtures date their documents fixtures::CREATED, and the MCP property test dates its local document as the headless one, so documents built at different moments compare equal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
remote_connect_fails_fast bound a port and dropped it, so another test or process could take the port before the connect and make it succeed. It now holds a socket bound without listening (socket2, a test-only dependency): connections to it are refused and nothing else can bind it meanwhile. It also checks the failure comes within 5 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes three tests that failed at random in CI, two caused by File Info's clock dates (#77) and one by a port race, and a fourth that was silently skipping cases whenever the clock ticked.
file.newand saves read their dates from the clock. A journal replayed a second later therefore rebuilt a different document, which failedjournal_replay_reproduces_document,rich_fixture_satisfies_invariants_and_undoes_to_blankand, latently,known_bugs::bug_nested_commands_double_journal.file.new {created?}, plusdocument.saveandfile.saveAs {modified?}: Unix seconds, ornullfor no date. They are read bycmd::date_paramand resolved and recorded bycmd::clock_date.SavePlan.modified), so every save stamps the same way. Save a Copy and templates leave the dates alone.Session::journal_for_action, which leaves these dates out (REPLAY_ONLY), so playing an action later dates the document then.fixtures::CREATED).mcp/tests/protocol_props.rs::run_command_sequences_match_local_sessionused to skip any case where the clock ticked. It now dates its local document like the headless one, and every case is compared.remote_connect_fails_fastholds its own closed port.socket20.6 (MIT OR Apache-2.0), as a test-only dependency ofvectorcraft-mcp.Known limit: a
file.newor save insidecommand.batchdoesn't get its date recorded, the same existing limit as the recorded preference values.Checks
Rebased onto
53f4279(#90).cargo xtask cipasses all 7 steps (fmt, clippy, test, assets, brands, layers, wasm): 2,334 tests, 0 failed.mainstill exists, with five added intests_journal.rs;UI_COMMANDS, menu entries and MCP tools are unchanged.remote_connect_fails_fastandrun_command_sequences_match_local_session.🤖 Generated with Claude Code