Skip to content

flake: TestUserSecretAuditDiffRedaction #1625

Description

@flake-investigator

CI Run Link: https://github.com/coder/coder/actions/runs/29981219738
Failing Job: test-go-pg (windows-2022)
Failure Date: 2026-07-23
Commit: 80f8e4f6245760619e5dc6c365af8b14a52cd67b (dependabot[bot])

Failure Evidence:

usersecrets_audit_test.go:92: 
	Error: Not equal:
		expected: ""
		actual  : "initial"
	Test: TestUserSecretAuditDiffRedaction
usersecrets_audit_test.go:93:
	Error: Not equal:
		expected: "initial"
		actual  : "after"
	Test: TestUserSecretAuditDiffRedaction
usersecrets_audit_test.go:115:
	Error: Not equal:
		expected: "initial"
		actual  : ""
	Test: TestUserSecretAuditDiffRedaction
usersecrets_audit_test.go:116:
	Error: Not equal:
		expected: "after"
		actual  : "initial"
	Test: TestUserSecretAuditDiffRedaction

Root Cause Assessment:

  • Flaky test due to nondeterministic ordering of audit log rows. Test assumes GetAuditLogsOffset returns create then update (rows[1]/rows[0]). Logs show the values swapped (createDiff has update values), which is consistent with ties on timestamp ordering or non-deterministic ordering when both entries share the same timestamp. No data race, panic, or OOM indicators in the logs.

Assignment Analysis:

  • git blame -L for TestUserSecretAuditDiffRedaction (enterprise/coderd/usersecrets_audit_test.go) points to commit 1c30d52b2bcc975313adada3cb7c58a7f20d0a73.
  • git log --oneline -10 --follow enterprise/coderd/usersecrets_audit_test.go shows latest meaningful change: 1c30d52b (feat: audit user secret create, update, and delete) by zedkipp.

Suggested Owner: @zedkipp

Related Issues:

  • None found after searching coder/internal for TestUserSecretAuditDiffRedaction, usersecrets_audit_test.go, and audit diff user secret.

Reproduction:

  • Not yet known. Likely intermittent; occurs when audit log row ordering flips for create/update rows.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions