Test whether flaky citus_split_shard_by_split_points_negative + cleanup

citus_split_shard_by_split_points_negative has something leftover.
If I run the test two times in a row in my local machine,
I get the following error in the second test run:

```diff
 -- UDF fails where source shard cannot be split further i.e min and max range is equal.
 -- Create a Shard where range cannot be split further
 SELECT isolate_tenant_to_new_shard('table_to_split', 1, shard_transfer_mode => 'block_writes');
- isolate_tenant_to_new_shard
----------------------------------------------------------------------
-                    49761305
-(1 row)
-
+ERROR:  could not open relation with OID 0
+CONTEXT:  while executing command on localhost:57637
 SELECT citus_split_shard_by_split_points(
        49761305,
        ARRAY['-1073741826'],
        ARRAY[:worker_1_node, :worker_2_node]);
-ERROR:  Cannot split shard id "49761305" as min/max range are equal: ('-1905060026', '-1905060026').
+ERROR:  could not find valid entry for shard 49761305
```

We need a resource cleanup here so I added that line.
pull/7338/head
naisila 2023-11-13 11:02:18 +03:00
parent 58b2cff86f
commit d3401b26a3
No known key found for this signature in database
GPG Key ID: A824BA9862D73E6D
2 changed files with 36 additions and 0 deletions

View File

@ -136,3 +136,33 @@ DETAIL: drop cascades to table citus_split_shard_by_split_points_negative.range
drop cascades to table citus_split_shard_by_split_points_negative.table_to_split
drop cascades to table citus_split_shard_by_split_points_negative.table_to_split_replication_factor_2
--END : Cleanup
SELECT public.wait_for_resource_cleanup();
wait_for_resource_cleanup
---------------------------------------------------------------------
(1 row)
SELECT result FROM run_command_on_all_nodes($$SELECT count(*) FROM pg_replication_slots$$);
result
---------------------------------------------------------------------
0
0
0
(3 rows)
SELECT result FROM run_command_on_all_nodes($$SELECT count(*) FROM pg_publication$$);
result
---------------------------------------------------------------------
0
0
0
(3 rows)
SELECT result FROM run_command_on_all_nodes($$SELECT count(*) FROM pg_subscription$$);
result
---------------------------------------------------------------------
0
0
0
(3 rows)

View File

@ -114,3 +114,9 @@ SELECT citus_split_shard_by_split_points(
\c - postgres - :master_port
DROP SCHEMA "citus_split_shard_by_split_points_negative" CASCADE;
--END : Cleanup
SELECT public.wait_for_resource_cleanup();
SELECT result FROM run_command_on_all_nodes($$SELECT count(*) FROM pg_replication_slots$$);
SELECT result FROM run_command_on_all_nodes($$SELECT count(*) FROM pg_publication$$);
SELECT result FROM run_command_on_all_nodes($$SELECT count(*) FROM pg_subscription$$);