Fixing tests in SalesforceSDKCore and MobileSync - #3914
Conversation
I debugged and verified the same cache was being used across NSURLSession but there seems to be NSURLSession session-level cache partitioning that causes the second round of calls to miss. I decided to rewrite testRestCalls and use a test subclass of SFSDKEncryptedURLCache. testRestCalls sends actual requests to the server twice. After the first set of calls, we make sure the cache was written to. After the second set of calls, we make sure the cache was read from.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #3914 +/- ##
==========================================
+ Coverage 63.35% 63.54% +0.18%
==========================================
Files 250 250
Lines 22504 22505 +1
==========================================
+ Hits 14258 14301 +43
+ Misses 8246 8204 -42
🚀 New features to boost your workflow:
|
…ipleRequests Avoiding OAuth refresh double callback race condition: - Remove double failure block invocation when OAuth refresh fails - Call triggering request's failure block then remove from queue before flush
Use consistent secure coding settings for both archiver and unarchiver to eliminate intermittent test failures with idData, customData, and accessScopes.
Clang Static Analysis Issues
Generated by 🚫 Danger |
|
All the SalesforceSDKCore tests are passing again :-) |
…ted app that does not have sfap_api scope
|
There are a bunch of new failures on the last run due to - I'll try again in a while:
I've deactivated the flows in the org. I guess we should not setup flows that fire notifications on Account save in the same org we are running tests that create and update many Accounts! |
testRestCalls
I debugged and verified the same cache was being used across NSURLSession but there seems to be NSURLSession session-level cache partitioning that causes the second round of calls to miss. I decided to rewrite testRestCalls and use a test subclass of SFSDKEncryptedURLCache. testRestCalls sends actual requests to the server twice. After the first set of calls, we make sure the cache was written to. After the second set of calls, we make sure the cache was read from.
testInvalidAccessAndRefreshToken_MultipleRequests
Avoiding OAuth refresh double callback race condition:
testUserAccountEncoding
Use consistent secure coding settings for both archiver and unarchiver to eliminate intermittent test failures with idData, customData, and accessScopes.
testStartFetchWithMaxTimestamp
Timestamp are rounded to the second so sleep so we need to sleep a bit before creating new accounts.