Skip to content

Commit

Permalink
drop table failure test no longer relies on reproducible output
Browse files Browse the repository at this point in the history
  • Loading branch information
lithp committed Jun 21, 2018
1 parent ae74048 commit 9133912
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
18 changes: 7 additions & 11 deletions src/test/regress/expected/failure_drop_table.out
Original file line number Diff line number Diff line change
Expand Up @@ -186,24 +186,20 @@ SELECT citus.mitmproxy('conn.contains(b"COMMIT PREPARED").kill()');

(1 row)

-- we've already sent COMMIT PREPARED to the other worker, so there's no turning back now!
-- we have, however, gained an entry in pg_dist_transaction. A later call to
-- recover_prepared_transactions() will fix that.
SELECT count(1) FROM pg_dist_transaction;
count
-------
8
(1 row)

-- we've already sent COMMIT PREPARED to the other worker, so there's no turning back now!
-- we have, however, gained an entry in pg_dist_transaction. A later call to
-- recover_prepared_transactions() will fix that.
SET citus.enable_unique_prepared_txn_ids TO false;
-- prepared transaction ids aren't reproducible (they embed information such as the
-- process PID), so suppress them and instead just assert that we've added a transaction
-- waiting to be cleaned up.
SET client_min_messages TO 'error';
DROP TABLE append;
WARNING: connection not open
CONTEXT: while executing command on localhost:57640
WARNING: failed to commit transaction on localhost:57640
WARNING: failed to roll back prepared transaction 'citus_0_16_4'
HINT: Run "COMMIT PREPARED 'citus_0_16_4'" on localhost:57640
WARNING: connection not open
CONTEXT: while executing command on localhost:57640
SELECT count(1) FROM pg_dist_transaction;
count
-------
Expand Down
7 changes: 5 additions & 2 deletions src/test/regress/sql/failure_drop_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ SELECT citus.mitmproxy('conn.contains(b"PREPARE TRANSACTION").kill()');
DROP TABLE append;

SELECT citus.mitmproxy('conn.contains(b"COMMIT PREPARED").kill()');
SELECT count(1) FROM pg_dist_transaction;
-- we've already sent COMMIT PREPARED to the other worker, so there's no turning back now!
-- we have, however, gained an entry in pg_dist_transaction. A later call to
-- recover_prepared_transactions() will fix that.
SET citus.enable_unique_prepared_txn_ids TO false;
SELECT count(1) FROM pg_dist_transaction;
-- prepared transaction ids aren't reproducible (they embed information such as the
-- process PID), so suppress them and instead just assert that we've added a transaction
-- waiting to be cleaned up.
SET client_min_messages TO 'error';
DROP TABLE append;
SELECT count(1) FROM pg_dist_transaction;

Expand Down

0 comments on commit 9133912

Please sign in to comment.