-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UnitTests] Fix order-dependent synchronous decorator tests
The decorator tests which used synchronous decorators started failing if they were run alone (before any of the other tests). This broke in d469daa , when I enabled `GTMStandardUserAgentProvider` by default in fetchers which don't otherwise specify a user-agent provider. The issue is that `GTMStandardUserAgentProvider` itself is asynchronous, but only the first time it's ever invoked (after that, it caches its result in a process-wide cache). The synchronous decorator tests assumed they'd always stay synchronous, but this wasn't the case if they used `GTMStandardUserAgentProvider` and were the first tests to run in the process. This fixes the issue by always providing a `GTMUserAgentStringProvider` for the synchronous decorator tests. Tested: `swift test` passes. Also ran test `-[GTMSessionFetcherServiceTest testMultipleDecoratorsSynchronous]` by itself and ensured it failed before this change and passed after this change.
- Loading branch information
1 parent
115f75e
commit 27d603b
Showing
1 changed file
with
13 additions
and
0 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