age: Periodic regression test "expr" failures
Describe the bug Regression test “expr” fails in rare cases
How are you accessing AGE (Command line, driver, etc.)? Accessing AGE through command line.
What data setup do we need to do? Apache AGE (master branch) with PostgreSQL (REL_15_STABLE).
What is the necessary configuration info needed? ./configure CFLAGS=" -Og" --enable-tap-tests --enable-debug --enable-cassert --prefix=/tmp/pgsql
What is the command that caused the error? I removed all tests except “expr” from the Makefile and put “make installcheck” in a loop to reproduce the failure.
diff --git a/Makefile b/Makefile
index ab98665..2f08858 100644
--- a/Makefile
+++ b/Makefile
@@ -76,30 +76,8 @@ EXTENSION = age
DATA = age--1.4.0.sql
# sorted in dependency order
-REGRESS = scan \
- graphid \
- agtype \
- catalog \
- cypher \
- expr \
- cypher_create \
- cypher_match \
- cypher_unwind \
- cypher_set \
- cypher_remove \
- cypher_delete \
- cypher_with \
- cypher_vle \
- cypher_union \
- cypher_call \
- cypher_merge \
- age_global_graph \
- age_load \
- index \
- analyze \
- graph_generation \
- name_validation \
- drop
+
+REGRESS = expr
srcdir=`pwd`
Start tests:
for i in `seq 1000000`;do echo "iteration $i";NO_TEMP_INSTALL=1 make -s installcheck || break;done
The test may fail at a random iteration. I received failures at iteration ~600, at iteration ~3500, and during the last run the test failed at iteration 199 with following “regression.diffs”:
iteration 199
+++ regress install-check in +++
============== creating temporary instance ==============
============== initializing database system ==============
============== starting postmaster ==============
running on port 61958 with PID 3302580
============== creating database "contrib_regression" ==============
CREATE DATABASE
ALTER DATABASE
ALTER DATABASE
ALTER DATABASE
ALTER DATABASE
ALTER DATABASE
ALTER DATABASE
============== installing age ==============
CREATE EXTENSION
============== running regression test queries ==============
test expr ... FAILED 643 ms
============== shutting down postmaster ==============
======================
1 of 1 tests failed.
======================
regression.diffs:
diff -U3 /home/test/work/subtree/age/regress/expected/expr.out /home/test/work/subtree/age/regre>
--- /home/test/work/subtree/age/regress/expected/expr.out 2023-12-06 13:30:29.282207296 +0>
+++ /home/test/work/subtree/age/regress/results/expr.out 2023-12-06 13:42:58.481465465 +0>
@@ -7217,12 +7217,12 @@
SELECT * FROM cypher('keys', $$MATCH ()-[e]-() RETURN keys(e)$$) AS (edge_keys agtype);
edge_keys
-----------
- []
- []
["song"]
["song"]
["song"]
["song"]
+ []
+ []
(6 rows)
SELECT * FROM cypher('keys', $$RETURN keys({a:1,b:'two',c:[1,2,3]})$$) AS (keys agtype);
But in some cases the test may fail with another regression.diffs:
diff -U3 /opt/pgpro/ent-14/src/apache-age-test/./regress/expected/expr.out /opt/pgpro/ent-14/src/apache-age-test/./regress/results/expr.out
--- /opt/pgpro/ent-14/src/apache-age-test/./regress/expected/expr.out 2023-09-26 17:35:01.000000000 +0300
+++ /opt/pgpro/ent-14/src/apache-age-test/./regress/results/expr.out 2023-11-30 06:00:38.531000000 +0300
@@ -6612,6 +6612,7 @@
ERROR: keys() argument must be a vertex, edge, object or null
SELECT * from cypher('keys', $$MATCH u=()-[]-() RETURN keys(u)$$) as (keys agtype);
ERROR: keys() argument must be a vertex, edge, object or null
+CONTEXT: parallel worker
SELECT create_graph('list');
NOTICE: graph "list" has been created
create_graph
Expected behavior Consistent test passing
Best regards, Egor Chindyaskin Postgres Professional: http://postgrespro.com/
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (14 by maintainers)
@rafsun42 Thank you! I have tested PR #1483. I have understood how to reproduce the issue faster. If you run tests on a virtual machine exactly with 2 cores, the error will repeat itself many times faster. So, on 2 core system I get the following results: regression.out:
regression.diffs:
Also, due to the setting of 2 cores, the “cypher_match” test began to fail. I’ve created a PR #1507 that fixes this test.
@rafsun42 We should make those changes so that these regression tests don’t fail. Failing, but still okay, doesn’t give warm fuzzies.
Interesting.
As Postgres suggests, regression tests are ‘not so pedantic’. Therefore, some tests might fail despite the test queries yielding correct results.
The first one is failing due to row-ordering difference. However, the output itself is correct. Since the order is not well-defined by the specification, we can assume ordering differences do not indicate incorrect result.
The second one is failing due to an addition of the notice ‘CONTEXT: parallel worker’. Since the diff does not show any other changes, I am assuming the query is producing the expected result. Except it is being executed by parallel workers.
It may be possible to fix the fails by adding an order by clause and setting config parameters.