Skip to content

Commit

Permalink
chore: relax auth test expiration window for CIs under high contention (
Browse files Browse the repository at this point in the history
#995)

* chore: relax auth test expiration window for CIs under high contention
  • Loading branch information
pratik151192 authored Oct 31, 2023
1 parent 3bd7066 commit 411b295
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ function sessionCredsProvider(): CredentialProvider {

export function integrationTestCacheClientProps(): CacheClientProps {
return {
configuration: Configurations.Laptop.latest(),
configuration:
Configurations.Laptop.latest().withClientTimeoutMillis(60000),
credentialProvider: credsProvider(),
defaultTtlSeconds: 1111,
};
Expand Down
10 changes: 5 additions & 5 deletions packages/common-integration-tests/src/auth-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ export function runAuthClientTests(
const secondsSinceEpoch = Math.round(Date.now() / 1000);
const expireResponse = await sessionTokenAuthClient.generateApiKey(
SUPER_USER_PERMISSIONS,
ExpiresIn.seconds(10)
ExpiresIn.minutes(5)
);
const expiresIn = secondsSinceEpoch + 10;

expect(expireResponse).toBeInstanceOf(GenerateApiKey.Success);
const expiresIn = secondsSinceEpoch + 300;

expect(expireResponse).toBeInstanceOf(GenerateApiKey.Success);
const expireResponseSuccess = expireResponse as GenerateApiKey.Success;
expect(expireResponseSuccess.is_success);
expect(expireResponseSuccess.expiresAt.doesExpire());
expect(expireResponseSuccess.expiresAt.epoch()).toBeWithin(
expiresIn - 1,
expiresIn + 2
expiresIn - 60,
expiresIn + 60
);
});

Expand Down

0 comments on commit 411b295

Please sign in to comment.