Skip to content

Fix nondeterministic age_global_graph regression test#2365

Open
jrgemignani wants to merge 1 commit intoapache:masterfrom
jrgemignani:fix_nondeterministic_age_global_graph_regression_test
Open

Fix nondeterministic age_global_graph regression test#2365
jrgemignani wants to merge 1 commit intoapache:masterfrom
jrgemignani:fix_nondeterministic_age_global_graph_regression_test

Conversation

@jrgemignani
Copy link
Copy Markdown
Contributor

@jrgemignani jrgemignani commented Apr 2, 2026

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: Claude Opus 4.6 noreply@anthropic.com

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to MATCH ... RETURN queries to ensure deterministic row ordering.
  • Suppressed nondeterministic dangling-edge WARNING output around graph_stats() via SET 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.

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.

2 participants