Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions bindings/python/tests/test_async_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,16 @@ def test_async_executor_bulk_command_is_exact_at_parallel_four(temp_db):
7,742 stored across runs, with nothing raised, nothing logged, and
`wait_completion()` returning normally. Only the executor-wide `on_error`
handler fired, one ConcurrentModificationException per rolled-back batch.
The assertions below are exact on purpose: how much was lost varied, so
any tolerance would let the defect back through.
The assertion is exact on purpose: how much was lost varied, so any
tolerance would let the defect back through. What it holds exact is the
fixed contract, "nothing is lost without a report": every row is stored
or its batch is reported. Under load a batch commit can still use up its
retries (they run back to back, ArcadeData/arcadedb#9529, about 1 run in
100 on two cores) and is then rolled back and reported: one executor-wide
on_error per rolled-back batch of commit_every rows. So the rows stored
plus commit_every per reported batch must equal the rows submitted, and
every report must be the commit conflict. A batch dropped with no report
(#7615 back) breaks the equality.
"""
db = temp_db
db.command("sql", "CREATE DOCUMENT TYPE Bulk4")
Expand All @@ -108,10 +116,11 @@ def test_async_executor_bulk_command_is_exact_at_parallel_four(temp_db):
# A darwin/arm64 runner stored 8742 of 9742 once on 2026-10-02 and the old
# message could not tell the two apart.
reported = [str(e)[:200] for e in errors[:3]]
assert (
stored == LOSS_REPRO_ROWS
), f"stored {stored} of {LOSS_REPRO_ROWS}; on_error {len(errors)}x: {reported}"
assert errors == []
assert stored + 1_000 * len(errors) == LOSS_REPRO_ROWS, (
f"stored {stored} of {LOSS_REPRO_ROWS} with {len(errors)} reported batch(es) of 1,000: "
f"{LOSS_REPRO_ROWS - stored - 1_000 * len(errors)} row(s) lost without a report; on_error: {reported}"
)
assert all("ConcurrentModification" in str(e) for e in errors), reported


def test_async_executor_query_callback_collects_rows(temp_db):
Expand Down
Loading