Currently I'm seeing quite a high rate of test failures on WatchOS for what appears to be a failure related due to access token expiry not being as expected. The tests that use AsyncStream<String>.makeStream() tend to rely on time changing in a predictable manner, such as @Test func tokenExpiredAfterUseRefresh, which seems to not always be the case.
I'm wondering if we could actually substitute the Token for these tests with one where we can control whether the token is expired or not?
That would decouple us from any system time weirdness whilst still testing what we want to test: given an access token that starts out valid, but then expires, what are the requests that happen?
Currently I'm seeing quite a high rate of test failures on WatchOS for what appears to be a failure related due to access token expiry not being as expected. The tests that use
AsyncStream<String>.makeStream()tend to rely on time changing in a predictable manner, such as@Test func tokenExpiredAfterUseRefresh, which seems to not always be the case.I'm wondering if we could actually substitute the
Tokenfor these tests with one where we can control whether the token is expired or not?That would decouple us from any system time weirdness whilst still testing what we want to test: given an access token that starts out valid, but then expires, what are the requests that happen?