Repository navigation
Conversation
The unit test mocks that mocker.py generates end every void function with a plain mock() call. For the functions declared pg_attribute_noreturn() that means the mock falls off its end, and GCC warns on every build of the unit tests: elog_mock.c: warning: 'noreturn' function does return It does so for ReThrowError, pg_re_throw, ExceptionalCondition, MemoryContextError, add_size_error, mul_size_error and WalSndShutdown. Have mocker.py collect the functions declared pg_attribute_noreturn() in the source file and in the headers it includes, following includes through the file's own directory and src/include, and end their mocks with abort(). The tests leave these mocks through a side effect that longjmps, so the abort() is never reached; a test that forgot to set one now stops there instead of running on past a call the compiler assumed never returns. The generated mocks differ from before only by those seven abort() calls. Assisted-by: Claude Code
1 of 13 tasks
leborchuk
approved these changes
Oct 26, 2026
leborchuk
left a comment
Contributor
There was a problem hiding this comment.
LGTM, I always generate mocks, really no need to fix it manually
Alena0704
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The unit test mocks that mocker.py generates end every void function with a plain mock() call. For the functions declared pg_attribute_noreturn() that means the mock falls off its end, and GCC warns on every build of the unit tests:
It does so for ReThrowError, pg_re_throw, ExceptionalCondition, MemoryContextError, add_size_error, mul_size_error and WalSndShutdown.
Have mocker.py collect the functions declared pg_attribute_noreturn() in the source file and in the headers it includes, following includes through the file's own directory and src/include, and end their mocks with abort(). The tests leave these mocks through a side effect that longjmps, so the abort() is never reached; a test that forgot to set one now stops there instead of running on past a call the compiler assumed never returns.
The generated mocks differ from before only by those seven abort() calls.
Assisted-by: Claude Code
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions