Skip to content

test: make API key status checks deterministic#2217

Open
JustinBacher wants to merge 1 commit into
Keeper-Security:masterfrom
JustinBacher:fix/deterministic-api-key-status-tests
Open

test: make API key status checks deterministic#2217
JustinBacher wants to merge 1 commit into
Keeper-Security:masterfrom
JustinBacher:fix/deterministic-api-key-status-tests

Conversation

@JustinBacher

@JustinBacher JustinBacher commented Jul 16, 2026

Copy link
Copy Markdown

Summary

  • freeze the current time in API key list tests that assert active/expired status
  • preserve the existing historical fixtures and exact JSON expectations
  • avoid changing production behavior or adding dependencies

Problem

The SIEM Tool fixture expires on 2026-07-08, but two tests expect it to be active. Once the real date passed that expiration, the tests began failing even though the production status calculation was correct.

How this was discovered

This surfaced while installing the keeper-commander package from the Arch User Repository. The package build runs the upstream test suite during check(), where these two tests failed after the fixture expiration date passed. Investigating the build failure showed that the package and production status logic were behaving correctly; the failure came from the tests depending on the real calendar date.

Test plan

  • Confirmed both affected tests fail before the change
  • Affected tests: 2 passed
  • Enterprise API key test module: 30 passed
  • Full unit suite on Python 3.14: 1451 passed, 59 skipped, 186 subtests passed

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