Skip to content

Proves the at-rest test's UPDATE assertion - #267

Merged
johnnyt merged 1 commit into
mainfrom
sp-a58z-at-rest-update-sabotage
Oct 11, 2026
Merged

johnnyt merged 1 commit into
mainfrom
sp-a58z-at-rest-update-sabotage

Conversation

@johnnyt

@johnnyt johnnyt commented Oct 11, 2026

Copy link
Copy Markdown
Member

Proves the step UPDATE assertion of the encrypting :blob_type test in test/statifier_persistence/ecto/position_blob_at_rest_test.exs on its own.

What changed

The test "an encrypting :blob_type keeps the location out of the stored column and the bound blob" had one verified sabotage (the custom blob type answering :binary), and that mutation turns the test red at the INSERT assertion first, so the refute on the step's UPDATE parameters had never been seen to fail by itself.

This adds a second sabotage note above the test, for a mutation that touches only the UPDATE path: in Storage.Ecto.update_execution/2, position_blob is dropped from the set: list and set through a query update with type(^blob, :binary). The INSERT path (do_insert_execution/3) is untouched by it.

Observed when run: the two INSERT assertions passed, and the test failed on refute Enum.any?(updates, ...) ("Expected false or nil, got true"): the step's UPDATE bound the raw position, which carries the location. The file was restored from a copy (byte-equal), recompiled with --force, and the test went green again.

Comment-only change; no code under lib/ moves.

Gate

Full mix quality green on the committed tree: format, compile (warnings as errors), doc links, dependencies, docs, credo, tests (all passed, coverage above the floor), dialyzer. Postgres from a local server on port 5432.

No changelog fragment: changelog.d/README.md excludes test-only changes with no public surface.

Review

In-turn review round (a test critic and a diff critic over the branch) before the request opened; the test critic asked that the note name the set: entry rather than a schema field, and the note says so. No record text in this change, so there is no direction check of a record.

The encrypting :blob_type test in position_blob_at_rest_test.exs had
one verified sabotage, and it went red at the INSERT first, so its
step UPDATE assertion had never been seen to fail on its own.

Records a second sabotage that touches only the UPDATE path: in
Storage.Ecto.update_execution/2, dropping position_blob from the
set: list and setting it through a query update with
type(^blob, :binary). Run against this test, the INSERT assertions
passed and the refute on the step's UPDATE parameters went red,
since the UPDATE bound the raw position carrying the location.
Reverted from a copy; the suite is green.

Test-only: no changelog fragment (changelog.d/README.md excludes
test-only changes).
@johnnyt
johnnyt merged commit c0bdb33 into main Oct 11, 2026
1 check passed
@johnnyt
johnnyt deleted the sp-a58z-at-rest-update-sabotage branch October 11, 2026 08:06
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.

1 participant