Commit 1afb909
authored
Fix slow unit tests for FilesExt (#1074)
## What changes are proposed in this pull request?
The unit tests for the FilesExt module are very slow because they
exercise the retry pathway using a real clock, resulting in long periods
spent waiting for retries. For unit tests, this is not necessary; they
can use the clock provided in the Config, which is a RealClock by
default in production but can be mocked in tests using FakeClock.
To fix this, I changed the call of `retried` to use the config's clock,
and then I updated the mock Config we provide as a fixture to use the
fake clock.
## How is this tested?
Existing tests should continue to work & pass.
Unit tests should be substantially faster than before.
NO_CHANGELOG=true1 parent 70d1788 commit 1afb909
2 files changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1337 | 1337 | | |
1338 | 1338 | | |
1339 | 1339 | | |
| 1340 | + | |
1340 | 1341 | | |
1341 | 1342 | | |
1342 | 1343 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments