Skip to content

fix(enterprise/coderd): identify audit rows by content instead of order in diff tests - #27904

Draft
dylanhuff-at-coder wants to merge 2 commits into
mainfrom
dylan/plat-429-flake-testusersecretauditdiffredaction
Draft

fix(enterprise/coderd): identify audit rows by content instead of order in diff tests#27904
dylanhuff-at-coder wants to merge 2 commits into
mainfrom
dylan/plat-429-flake-testusersecretauditdiffredaction

Conversation

@dylanhuff-at-coder

@dylanhuff-at-coder dylanhuff-at-coder commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

TestUserSecretAuditDiffRedaction flakes when create and update audit rows receive equal timestamps and GetAuditLogsOffset returns the tied rows in either order.

Identify audit rows by action, or by diff content when both actions are writes, instead of relying on slice position. Fixes coder/internal#1625.

Reviewed and updated by Coder Agents on behalf of @dylanhuff-at-coder.

…er in diff tests

GetAuditLogsOffset orders by time only, and audit timestamps are rounded
to microsecond. On Windows CI the clock resolution is coarse enough that
the create and update audit rows frequently tie, making the returned
order nondeterministic and flaking TestUserSecretAuditDiffRedaction.

Select rows by audit action (or by diff content where both rows share an
action) instead of by slice position in the four audit diff tests that
relied on ordering.

Fixes coder/internal#1625
@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

PLAT-429

@dylanhuff-at-coder
dylanhuff-at-coder marked this pull request as ready for review August 5, 2026 22:40
@dylanhuff-at-coder
dylanhuff-at-coder marked this pull request as draft August 5, 2026 22:46
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.

flake: TestUserSecretAuditDiffRedaction

1 participant