Fix nondeterministic age_global_graph regression test#2365
Open
jrgemignani wants to merge 1 commit intoapache:masterfrom
Open
Fix nondeterministic age_global_graph regression test#2365jrgemignani wants to merge 1 commit intoapache:masterfrom
jrgemignani wants to merge 1 commit intoapache:masterfrom
Conversation
The age_global_graph test had two issues that could cause intermittent failures: 1. Nondeterministic warning output: The graph_stats() call on a graph with deliberately deleted vertices produces WARNING messages for dangling edges. These warnings are emitted by iterating edge label tables (knows, stalks), and the iteration order is not guaranteed. Since PostgreSQL WARNING messages cannot be caught or counted from SQL (only ERROR and above are catchable via PL/pgSQL exception handling), we suppress them with SET client_min_messages = error. The suppressed warnings are documented verbatim in comments. The graph_stats() result row still validates correct dangling-edge handling. 2. Nondeterministic row ordering: Multiple MATCH...RETURN queries returned multi-row results without ORDER BY, relying on scan order. Added ORDER BY id(u), id(v), id(e), id(n), or id(a) as appropriate to all MATCH...RETURN queries for future-proofing, even those currently returning a single row. Files changed: regress/sql/age_global_graph.sql regress/expected/age_global_graph.out Co-authored-by: GitHub Copilot <noreply@github.com>
There was a problem hiding this comment.
Pull request overview
This PR stabilizes the age_global_graph regression test by eliminating nondeterministic output sources (unordered result sets and unordered WARNING emission during graph_stats() on intentionally corrupted graphs).
Changes:
- Added explicit
ORDER BY id(...)clauses toMATCH ... RETURNqueries to ensure deterministic row ordering. - Suppressed nondeterministic dangling-edge WARNING output around
graph_stats()viaSET client_min_messages = error, documenting the suppressed warnings in comments, and restoring the setting afterward. - Updated expected regression output to match the stabilized SQL behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| regress/sql/age_global_graph.sql | Adds deterministic ORDER BY to Cypher queries and suppresses nondeterministic WARNING output around graph_stats() with a SET/RESET block. |
| regress/expected/age_global_graph.out | Updates expected results to reflect the new ordering and the absence of suppressed WARNING lines, including SET/RESET echo lines. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The age_global_graph test had two issues that could cause intermittent failures:
Nondeterministic warning output: The graph_stats() call on a graph with deliberately deleted vertices produces WARNING messages for dangling edges. These warnings are emitted by iterating edge label tables (knows, stalks), and the iteration order is not guaranteed. Since PostgreSQL WARNING messages cannot be caught or counted from SQL (only ERROR and above are catchable via PL/pgSQL exception handling), we suppress them with SET client_min_messages = error. The suppressed warnings are documented verbatim in comments. The graph_stats() result row still validates correct dangling-edge handling.
Nondeterministic row ordering: Multiple MATCH...RETURN queries returned multi-row results without ORDER BY, relying on scan order. Added ORDER BY id(u), id(v), id(e), id(n), or id(a) as appropriate to all MATCH...RETURN queries for future-proofing, even those currently returning a single row.
Files changed:
regress/sql/age_global_graph.sql
regress/expected/age_global_graph.out
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com