Skip to content
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

Module "mock-socket" can cause false test positives and negatives #75

Open
tbuschto opened this issue Jan 10, 2020 · 0 comments
Open

Module "mock-socket" can cause false test positives and negatives #75

tbuschto opened this issue Jan 10, 2020 · 0 comments

Comments

@tbuschto
Copy link
Member

tbuschto commented Jan 10, 2020

There are multiple issues with the library, specifically with the server mock used - in our case - as a drop-in replacement for the ws Server. It may be the case that that is not its intended use case.

Issues:

This also prevents us from implementing this test:

    it('prints connect on slow reconnect', async function() {
      const rc = createRemoteConsoleClient(debugServer, webSocketFactory);
      const logPromise = waitForCalls(terminal.log, 2, 8000);
      rc._webSocket.close(1000);
      rc._disposeSocket();
      await new Promise(resolve => setTimeout(resolve, 4000));
      rc._connect();
      const log = await logPromise;
      expect(log).to.contain(' connected');
    }).timeout(10000);
review-squirrel pushed a commit that referenced this issue Jan 10, 2020
Once a disconnect message was printed once it would not print a connect
message for the same session again since a timer id wasn't reset.

No unit test was possible since the mock-socket has certain
incompatibilities/limitations that make it impossible to distinguish
different sockets. An upgrade of that module introduced different
problems documented in CLI issue #75

Change-Id: I187ccb4ac4e84009dc8dc144c66eccf52e4d06a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant