-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Implement logic to clear LocalGcs after each test (#1661)
Fixes #1578 Change description: * there are only 2 tests that require pre-uploaded files -- now they upload filed on their own (`ArgsHelperTest#assertGcsFileExists succeeds` & `TestRunnerTest#mockedAndroidTestRun gcsAndHistoryName`) * Google API provides `FakeStorageRpc` which is created with `LocalStorageHelper.getOptions()` * `FakeStorageRpc` can be cleaned/reseted only by calling `LocalStorageHelper.getOptions()` (both its hashmaps are cleared) * Above is, unfortunately, the only way to clear `FakeStorageRpc` -- storage has `reset` method but it's not exposed * The `TestStorageProvider` is introduced to wrap additional test logic * Intention behind `TestStorageProvider` is `GcStorage` should not be aware of how it is used (tests or production ) * The `TestStorageProvider` has nullable `Storage` filed. It can be cleared (set null) with `#clearStorage` * If storage is null `TestStorageProvider` will invoke `LocalStorageHelper.getOptions()` and assign reference to storage field. * `FlankTestRunner` has a custom listener that will invoke `LocalGcs#clear()` after each test run ## Test Plan > How do we know the code works? Unfortunately, there is no straightforward way to verify it since OOM error occurred only on GH Actions machines, randomly.
- Loading branch information
1 parent
fe72d53
commit 1b66685
Showing
5 changed files
with
47 additions
and
10 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