Skip to content

Rust #325: compare activity lease renewals as instants, not RFC3339 text - #735

Closed
rmcdaniel wants to merge 1 commit into
mainfrom
rust-325-lease-instant-compare
Closed

rmcdaniel wants to merge 1 commit into
mainfrom
rust-325-lease-instant-compare

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Part of #325. Security class: R0 (test only).

Problem

activity_deadlines::heartbeat_renews_only_progress_deadline_and_cannot_resurrect_elapsed_authority compared two lease_expires_at values as RFC3339 strings.

Native times are whole milliseconds, and chrono writes an instant on a whole second without a fraction (...:26Z). So about one run in a thousand, a claim lease of ...:26Z sorts after a later renewal of ...:26.045Z, and the assertion fails. It failed this way on train #729's PostgreSQL 17 job 120852521096 (classification: #729 (comment)).

Change

The test parses both values and compares the instants, and the assertion message prints both values. No product code changes.

Order

This merges after #729, so #729 does not have to take main again.

heartbeat_renews_only_progress_deadline_and_cannot_resurrect_elapsed_authority
compared two lease_expires_at strings. Native times are whole
milliseconds and serialize without a fraction on a whole second, so a
claim lease of ...:26Z sorted after a renewal of ...:26.045Z and the
assertion failed about one run in a thousand (train #729, PostgreSQL 17
job 120852521096). The test now parses both and reports the values.
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Folded into #741 (one R0 change set: the test fix plus the CI lanes), so both qualify in one run.

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