[Tests] Add more complex user switching tests#1430
Merged
Conversation
* Some requests executed too quickly and need small delay to mimic real server calls * This was motivated by flaky behavior where Identify User will return very quickly and the user in the SDK should have changed by then, but did not.
d53e36c to
4d0e3e7
Compare
18 tasks
jkasten2
approved these changes
May 9, 2024
* These changes were motivate by need to check if [subscription: [token: email] is within a fuller subscription payload
* Move user switching tests to new test class * Remove test `testIdentifyUserWithConflict_whenNotCurrentUser_sendsCorrectTags` as its behavior is already being tested in the new tests
* Test was failing, increase the time we give to run all threads, and increase the delay in the Client to simulate request making
* SwitchUserTests to SwitchUserIntegrationTests
46efbac to
7d60db6
Compare
jkasten2
approved these changes
May 9, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Add more complex user switching tests involving multiple calls to login / logout / user updates in a short span.
Details
Motivation
Scope
Unit tests
Testing
Unit testing
Added new test class
SwitchUserTeststestIdentifyUserSuccessfully_thenLogin_sendsCorrectTags- existing test migrated from other filetestAnonUser_thenIdentifyUserWithConflict_sendsCorrectUpdatesAndFetchesUser- Starts up with creating the anon user, then a login with conflict happens.testAnonUser_thenIdentifyUserWithConflict_thenLogout_sendsCorrectUpdatesWithNoFetch- Starts up with creating the anon user, then a login with conflict happens, then a logout happens.testAnonUser_thenIdentifyUserWithConflict_thenLogin_sendsCorrectUpdatesAndFetchesUser- Starts up with creating the anon user, then a login with conflict happens, then a login to another user happens.Manual testing
None, app runs.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is