OpenSearch/x-pack/plugin/security
Ioannis Kakavas 24a794fd6b Fix testTokenExpiry flaky test (#42585)
Test was using ClockMock#rewind passing the amount of nanoseconds
in order to "strip" nanos from the time value. This was intentional
as the expiration time of the UserToken doesn't have nanosecond
precision.
However, ClockMock#rewind doesn't support nanos either, so when it's
called with a TimeValue, it rewinds the clock by the TimeValue's
millis instead. This was causing the clock to go enough millis
before token expiration time and the test was passing. Once every
few hundred times though, the TimeValue by which we attempted to
rewind the clock only had nanos and no millis, so rewind moved the
clock back just a few millis, but still after expiration time.

This change moves the clock explicitly to the same instant as expiration,
using clock.setTime and disregarding nanos.
2019-05-30 07:53:56 +03:00
..
cli Simplify filtering addresses on interfaces (#41758) 2019-05-02 16:36:27 -04:00
forbidden Add an OpenID Connect authentication realm (#40674) (#41178) 2019-04-15 12:41:16 +03:00
licenses Add an OpenID Connect authentication realm (#40674) (#41178) 2019-04-15 12:41:16 +03:00
qa Add cluster restart for security on basic (#42217) 2019-05-22 14:27:45 +10:00
src Fix testTokenExpiry flaky test (#42585) 2019-05-30 07:53:56 +03:00
build.gradle Switch run task to use real distro (#41590) 2019-05-06 12:34:07 -07:00