Skip to content

Freeze time in ExpiringRequestCounter new-user spec - #5624

Open
philippthun wants to merge 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix-rate-limiter-ttl-boundary
Open

philippthun wants to merge 1 commit into
cloudfoundry:mainfrom
sap-contributions:fix-rate-limiter-ttl-boundary

Conversation

@philippthun

Copy link
Copy Markdown
Member

The mock_redis store records expiry as now + expires_in and reads it back via TTL. When the SET and TTL reads fall on different seconds, the TTL is one low and the example failed intermittently. Freeze time around the increment, like the recurring-user example, so both reads see the same instant.

This change was developed with AI assistance; all code was reviewed and tested by me.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

The mock_redis store records expiry as now + expires_in and reads it
back via TTL. When the SET and TTL reads fall on different seconds, the
TTL is one low and the example failed intermittently. Freeze time around
the increment, like the recurring-user example, so both reads see the
same instant.

This branch has not been deployed

No deployments
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