Skip to content

test: make TestJSONRPC_DeletePushConfigResponse deterministic - #537

Merged
yarolegovich merged 1 commit into
mainfrom
yarolegovich/deflake-delete-push-config
Nov 5, 2026
Merged

yarolegovich merged 1 commit into
mainfrom
yarolegovich/deflake-delete-push-config

Conversation

@yarolegovich

Copy link
Copy Markdown
Member
  • TestJSONRPC_DeletePushConfigResponse ignores the ErrorInfo timestamp when comparing responses, as the error conversion tests in internal/jsonrpc, internal/rest and internal/grpcutil already do. The expected error is built when the test cases are declared, and jsonrpc.ToJSONRPCError stamps the current time with second precision, so the test failed whenever the handler ran in the next second.

The test failed this way today on #505, #531 and #536. Sleeping until the next second before calling the handler fails the old test in every run and passes with this change.

* `TestJSONRPC_DeletePushConfigResponse` ignores the ErrorInfo
`timestamp` when comparing responses, as the error conversion tests in
`internal/jsonrpc`, `internal/rest` and `internal/grpcutil` already do.
The expected error is built when the test cases are declared, and
`jsonrpc.ToJSONRPCError` stamps the current time with second precision,
so the test failed whenever the handler ran in the next second.

The test failed this way today on #505, #531 and #536. Sleeping until
the next second before calling the handler fails the old test in every
run and passes with this change.
@yarolegovich
yarolegovich merged commit e5e05f9 into main Nov 5, 2026
5 checks passed
@yarolegovich
yarolegovich deleted the yarolegovich/deflake-delete-push-config branch November 5, 2026 12:55
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