-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Test] Add synchronizer in UserStateFactory to avoid randomly failed #120
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the problem is from the UserStateFactory
. In the UserStateFactory
, there's no synchronizer, while we initiate the UserStateFactory
, the type of synchronizer is Synchronizer
not UnirepSocialSynchronizer
whose eventHandler does not contain UnirepApp
events. Hence, even we execute userState.waitForSync()
, the synchronizer does not sync the UserSignUp
event.
Thanks @chentihe, I think this is the root cause! Add one more commit for this |
48dfba0
to
d08a33d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can init a user state without a synchronizer
d08a33d
to
69fa9bf
Compare
✅ Deploy Preview for unirep-social-taiwan canceled.
|
69fa9bf
to
6e007c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unit test will pass randomly because there's a UnirepSocialSynchronizer
while the server starts. UnirepSocialSynchronizer
will also fetch the new block to handle the event asynchronously. Because of this, the unit test may pass randomly. we still need to set UnirepSocialSynchronizer
into UserState
to prevent this error.
Please follow the guidelines in Contribution.md first, then start to create your pull request here.
Summary
Fix the randomly test failed issue
Linked Issue
#119
Details
add await before create method
Impacted Areas
signup test
Tests
Possible Impacts
signup test
Visual Materials
Verification Steps
Todo
Checklist
yarn lint:fix