-
Notifications
You must be signed in to change notification settings - Fork 934
Adding getActiveClients() #586
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
Adding getActiveClients() #586
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.
Probably LGTM, but I have a question...
await this.persistence.start(); | ||
await this.localStore.start(); | ||
await this.remoteStore.start(); | ||
async startIfNeeded(): Promise<void> { |
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.
Why does this need to be idempotent now? I'm not exactly following what changed.
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 way this was implemented before called start()
for all clients before execution any of the steps in the tests. That meant by the time client(0).expectNumActiveClients(1) was called, we had already initialized both clients, causing this test to fail.
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.
Oh... I see. We're creating clients at the start, but not starting them until later... Would it be possible / make sense to just not create them until needed?
I'm a bit worried about making SpecTestRunner deviate too much from other platforms. If nothing else, it seems like we should have some "PORTING NOTE" comments if we're going to change how start() works here...
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 added a PORTING NOTE comment and moved this logic to an inner function (ensureRunner).
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.
LGTM. Thanks for reworking.
This will be used by SharedClientState to retrieve the list of active clients during its startup. Using this list, the SharedClientState can then read all relevant rows in LocalStorage.