Skip to content

Add test for verifying exception handling - #585

Open
mason-sharp wants to merge 1 commit into
v5_STABLEfrom
task/SPOC-643/follow-on-test
Open

Add test for verifying exception handling#585
mason-sharp wants to merge 1 commit into
v5_STABLEfrom
task/SPOC-643/follow-on-test

Conversation

@mason-sharp

Copy link
Copy Markdown
Member

For in between transactions.

This needs PR #584 to be merged first before the test passes, but the test is also purposely not in the CI schedule.

For in between transactions.
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: be6db5af-452d-45ab-8312-19b27e9cddad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mason-sharp
mason-sharp requested a review from danolivo August 18, 2026 20:37
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.


# The worker is idle here, so the cancel lands between transactions with
# nothing queued -- the state the fix is about.
sleep(2);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think a sleep call here is a source of instability. I'd recommend using sync_event instead.

# worker's exception log slot, which is what the incoming transaction is
# compared against after the cancel.
psql_or_bail(1, "INSERT INTO $t VALUES (1, 'before cancel')");
is(wait_for_row($t, 1), '1', "$mode: baseline transaction replicates");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd say it is too complicated. Use existing machinery: sync_event and table selection instead.


psql_or_bail(2, "ALTER SYSTEM SET spock.exception_behaviour = $mode");
psql_or_bail(2, "SELECT pg_reload_conf()");
sleep(2);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's a little annoying and delays tests. Maybe we can introduce a routine to apply extra parameters at instance start? It might help other tests to be a little more stable (and faster).

Comment thread tests/tap/t/037_no_replay_mode_leak.pl
@@ -0,0 +1,165 @@
use strict;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Check if 037 is free to use in both main and v5 branches

}

destroy_cluster('Destroy replay mode leak cluster');
done_testing();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Basically, nice sketch. Just make it simpler and introduce general mechanics into SpockTest.pm if needed - especially if vanilla's one already has something similar.

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