cloudant / java-cloudant

A Java client for Cloudant
Apache License 2.0
79 stars 68 forks source link

Fixed timing window in `testNewCookieRequestMadeAfterExpiry` test #461

Closed ricellis closed 6 years ago

ricellis commented 6 years ago

Checklist

Description

Fixed timing window in testNewCookieRequestMadeAfterExpiry

Fixes #460

Approach

There were some truncations from millisecond timestamps from System.currentTimeMillis() to cookie-date format which only has 1 second granularity. Under unfavourable circumstances this could reduce the time of the cookie lifetime by up to nearly 2 seconds. Since the test was using a 2 second cookie lifetime occasionally there would be a very small window for the test requests to actually be made before the cookie "expired".

Resolved by:

Note these are test only changes.

Schema & API Changes

Security and Privacy

Testing

Monitoring and Logging