-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(parameters): AppConfigProvider to return the last valid value wh…
…en the API returns empty value on subsequent calls (#1365) * Closes 1363 Add a local cache to AppConfigProvider to handle the scenario where the maxAge is expired, but the AppConfig session still has the latest configuration. In this case, AppConfig returns an empty value. We don't want to return empty values to our callers. This uses the same data structure we have in place to track NextPollConfigurationToken. This approach roughly the Python library's behavior. * Add E2E test coverage checking return values pre- and post-expiration Includes update to e2e lambda config type that allows test writers to specify a test function duration. Needed because to wait for parameter expiration, we needed a longer-than-default timeout. * Use timestamp/millisecond based math for checking expiration. * Revert "Use timestamp/millisecond based math for checking expiration." This reverts commit 3fea0d7. Further testing shows that the original algorithm was correct. * Update appConfig integration tests to use single log line. Drop wait, use maxAge instead. Add comment for Test case 7. Fix test case naming (test '4' was skipped on one of the files). * Revert increase of Lambda function duration back to default. Not needed anymore since we're not waiting for Test 7. * Focus value test integration tests on Test 7 * Comma formatting * Add unit tests for ExpirableValue Doesn't refactor ExpirableValue to take an injection of Date.now, just implements tests based on what we can do with the existing interface. * Address formatting feedback and updates comments to indicate we're no longer waiting during Test 7 runs. * Adjust log message structure to match pattern Specfically test/value as top-level properties. * Move client reset to afterEach for consistency. * Drop old reset
- Loading branch information
Showing
5 changed files
with
176 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters