Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug utilities to debug builds #5649

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

mkindahl
Copy link
Contributor

@mkindahl mkindahl commented May 3, 2023

This will move the definitions of debug_waitpoint_enable, debug_waitpoint_disable, and debug_waitpoint_id to always be defined for debug builds and modify existing tests accordingly.

This means that it is no longer necessary to generate isolation test files from templates (in most cases), and it will be straightforward to use these functions in debug builds.

The debug utilities can be disabled by setting the option ENABLE_DEBUG_UTILS to OFF.

Disable-check: force-changelog-file, commit-count

@mkindahl mkindahl force-pushed the debug-waitpoint-for-debug-build branch 2 times, most recently from 29aacba to f93fa72 Compare August 9, 2023 15:34
@mkindahl mkindahl marked this pull request as ready for review August 9, 2023 15:35
@github-actions
Copy link

github-actions bot commented Aug 9, 2023

@jnidzwetzki, @pmwkaa: please review this pull request.

Powered by pull-review

@mkindahl mkindahl marked this pull request as draft August 9, 2023 16:27
@mkindahl mkindahl force-pushed the debug-waitpoint-for-debug-build branch 6 times, most recently from 1ca6468 to 94863a1 Compare August 10, 2023 11:31
@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #5649 (7a7fe48) into main (4bd704f) will decrease coverage by 0.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #5649      +/-   ##
==========================================
- Coverage   87.09%   87.05%   -0.05%     
==========================================
  Files         243      243              
  Lines       55967    55921      -46     
  Branches    12383    12364      -19     
==========================================
- Hits        48746    48680      -66     
- Misses       4891     4902      +11     
- Partials     2330     2339       +9     

see 21 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mkindahl mkindahl marked this pull request as ready for review August 10, 2023 12:35
# These tests are using markers for the isolation tests (to avoid race
# conditions causing differing output), which were added after 12.7, 13.3, and
# 14.0.
if(PG_VERSION VERSION_GREATER "12.7"
Copy link
Member

Choose a reason for hiding this comment

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

We removed support for PG12 recenlty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Test is harmless, but it is trivial to remove. Might be good to still keep the comment though, in case anybody want to test a build with deprecated versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Leaving it for now. It is trivial to remove, but will generate weird errors if somebody tries to use it for PG12 even though it is deprecated.

@@ -25,6 +25,7 @@ option(
ENABLE_OPTIMIZER_DEBUG
"Enable OPTIMIZER_DEBUG when building. Requires Postgres server to be built with OPTIMIZER_DEBUG."
OFF)
option(ENABLE_DEBUG_UTILS "Enable debug utilities for the extension." ON)
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a separate setting? Maybe always enable them in Debug builds?

Copy link
Contributor

Choose a reason for hiding this comment

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

I am also in favor of enabling that in every debug build.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are by default enabled, and since the functions are not defined for non-debug builds, this is how it currently behaves.

This will move the definitions of `debug_waitpoint_enable`,
`debug_waitpoint_disable`, and `debug_waitpoint_id` to always be
defined for debug builds and modify existing tests accordingly.

This means that it is no longer necessary to generate isolation test
files from templates (in most cases), and it will be straightforward to
use these functions in debug builds.

The debug utilities can be disabled by setting the option
`ENABLE_DEBUG_UTILS` to `OFF`.
The telemetry isolation test `telemetry_iso` does not test anything and
does not seem to work, so it is removed. The debug waitpoint was taken
in the same session, so the waitpoint was not waited on.
@mkindahl mkindahl force-pushed the debug-waitpoint-for-debug-build branch from 6af8df6 to 7a7fe48 Compare August 14, 2023 11:53
@mkindahl mkindahl enabled auto-merge (rebase) August 14, 2023 12:03
@mkindahl mkindahl merged commit 1102d34 into timescale:main Aug 14, 2023
38 of 39 checks passed
@mkindahl mkindahl deleted the debug-waitpoint-for-debug-build branch August 14, 2023 12:42
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.

None yet

3 participants