Skip to content

Conversation

@clundin25
Copy link
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

…erless tokens are cached until 4 minutes before expiration, so 4 minutes is the ideal refresh window.
private static final long serialVersionUID = 4556936364828217687L;
static final Duration DEFAULT_EXPIRATION_MARGIN = Duration.ofMinutes(5);
static final Duration DEFAULT_EXPIRATION_MARGIN = Duration.ofMinutes(3).plusSeconds(45);
static final Duration DEFAULT_REFRESH_MARGIN = Duration.ofMinutes(6);
Copy link

@TimurSadykov TimurSadykov Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to change both? This to 4 mins or slightly below and expiration to below 3min.

Right now it will start refreshing at 6 mins and get insta cached response for next 2 mins.

Copy link

@TimurSadykov TimurSadykov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left comment on changing both values

@clundin25
Copy link
Contributor Author

Left comment on changing both values

Good point. I have revised the change

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

@TimurSadykov TimurSadykov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@TimurSadykov TimurSadykov merged commit a7a8d7a into googleapis:main Jan 11, 2024
@TimurSadykov
Copy link

@clundin25 Hey sorry for the late comment... but it looks like those margins aren't covered with tests, could you please add those? There are margin related tests in ComputeCredentialTests

@clundin25
Copy link
Contributor Author

@TimurSadykov
Copy link

@clundin25 it is a bit more than a getter validation. The test you highlighted validates that compute credentials has their specific margins set. As i understand similar tests are missing for other credentials that supposed to use defaults. It could be that custom margins set up for some credentials and its a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: xs Pull request size is extra small.

3 participants