Skip to content

test: bracket the scoped database size by both system readings - #141

Merged
alex-feel merged 1 commit into
mainfrom
test/database-size-reading
Oct 26, 2026
Merged

alex-feel merged 1 commit into
mainfrom
test/database-size-reading

Conversation

@alex-feel

Copy link
Copy Markdown
Collaborator

Why

The access-scope case that proves database_size_mb is a deployment-wide figure read the size as the system scope before and after the scoped read and required the three readings to grow in order. On PostgreSQL pg_database_size can shrink between two readings when a vacuum truncates a relation or temporary files go away, so the case failed in a full-suite run while every count it checked was right.

What changes

The scoped reading is accepted when it lies between the two system readings in either order. The case keeps proving the same property: the figure a caller sees is the deployment's size, never a per-scope one.

The deployment-wide size check read the database size as the system scope before and after the scoped read and required the three readings to grow in order.
On PostgreSQL pg_database_size can shrink between two readings when a vacuum truncates a relation or temporary files go away, so the check failed while every count was right.
The scoped reading is now accepted when it lies between the two system readings in either order.
@github-actions

Copy link
Copy Markdown

Coverage report

This PR does not seem to contain any modification to coverable code.

@alex-feel
alex-feel merged commit 4dda346 into main Oct 26, 2026
6 checks passed
@alex-feel
alex-feel deleted the test/database-size-reading branch October 26, 2026 05:18
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.

1 participant