Skip to content

Fail loudly when the result graph is gone - #8

Closed
seebi wants to merge 1 commit into
mainfrom
bugfix/legible-result-graph-assertions
Closed

seebi wants to merge 1 commit into
mainfrom
bugfix/legible-result-graph-assertions

Conversation

@seebi

@seebi seebi commented Sep 8, 2026

Copy link
Copy Markdown
Member

Why

The check on main went red on test_safe_as_graph with assert 0 == 16, which reads as the validation wrote no results. It was not that. The result graph had vanished from the deployment, and _get_triple_count returned 0 for it because a graph missing from the graph list was indistinguishable from an empty one:

if graph not in client.graphs:
    return 0

Reproduced against a local deployment — the batch reports FINISHED, yet the graph is gone and stays gone:

--- run 3: FINISHED
    t+0.0s  listed=False  exported=export failed: RepositoryItemNotFoundError

It is intermittent (the same probe run again wrote its 48 triples normally) and it is not a plugin problem. But the assertion made it look like one, and cost a diagnosis to tell apart.

What

  • _get_triple_count now calls pytest.fail naming the graph, so the failure reads Graph <http://docker.localhost/results/> does not exist in the deployment instead of assert 0 == 16.
  • The pre-condition in test_safe_as_graph that the zero was really serving is written as the membership check it always was.
  • The message on the first count assertion said "result graph should be empty" while asserting > 0.

No changelog entry — nothing here changes what a user of the plugin sees.

Still open

validate_graph/task.py:180 breaks out of the poll loop on any status that is not SCHEDULED/RUNNING, ERROR included, then reports "Found N Violations" as success. A batch failing server-side yields an empty result graph and a green workflow task. Not touched here — it is a user-visible plugin bug and wants its own change and changelog entry.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SxhW9xhADjcpzFezfXBBDk

_get_triple_count treated a graph which is not in the graph list as a graph
with zero triples. When the deployment loses the result graph during a
validation - which happens intermittently, reproducibly, and is not a plugin
problem - the test reported it as "assert 0 == 16", an assertion about numbers
which says nothing about what actually went wrong.

The helper now fails with the graph IRI instead, and the pre-condition of
test_safe_as_graph, which is what the zero was really there for, is written as
the membership check it always was. The message on the first count assertion
said "result graph should be empty" while asserting the opposite.

No changelog entry: nothing here changes what a user of the plugin sees.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SxhW9xhADjcpzFezfXBBDk
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
File Stmts Miss Cover Missing
init.py 0 0 100%
validate_entities/init.py 0 0 100%
validate_entities/state.py 10 0 100%
validate_entities/task.py 134 38 72% 192 201 212 223-226 231 233-235 249 263-264 286 291 321 323-324 327-330 333-336 338 340-342 344 349 352-353 355 357-358
validate_graph/init.py 0 0 100%
validate_graph/state.py 22 0 100%
validate_graph/task.py 77 6 92% 187-188 195-196 199 206
TOTAL 243 44 82%  

Tests Skipped Failures Errors Time
7 0 💤 0 ❌ 0 🔥 72.665 ⏱

@seebi seebi closed this Sep 8, 2026
@seebi
seebi deleted the bugfix/legible-result-graph-assertions branch September 8, 2026 13:38
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