Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Failing to show test run report when running with remote selenium server #41

Open
ckm2k1 opened this issue Apr 7, 2017 · 1 comment

Comments

@ckm2k1
Copy link

ckm2k1 commented Apr 7, 2017

We've been seeing an issue with the reporter failing to show a report at the end of a test run.
At the moment, this only happens when using a remote selenium server with the test code running on the local machine.

The cause of the issue seems to be the timeout setting in function:

   waitUntilSettled () {
        return new Promise((resolve) => {
            const start = (new Date()).getTime()
            const interval = setInterval(() => {
                const now = (new Date()).getTime()

                if (this.sentMessages !== this.receivedMessages && now - start < SETTLE_TIMEOUT) return
                clearInterval(interval)
                resolve()
            }, 100)
        })
    }

The child process fires all of its test run messages to the parent in quick succession, but because of the 5sec timeout, never has a chance to get a response from the parent which means no test results in the console. Raising the timeout to 30sec didn't help. Screenshot of a test run with no output.
image

Removing the timeout completely does solve the issue, but doesn't address the underlying problem that the parent process takes a very long time to respond to the messages.
image

Debugging this a little further, we noticed that this line returns false when firing messages to the parent.
https://github.com/webdriverio/wdio-mocha-framework/blob/master/lib/adapter.js#L239

Node docs indicate this happens when the IPC backlog exceeds a threshold, or parent has exited. Since messages are processed given enough time, points to the IPC backlog being full.

For the moment we're simply going to remove the timeout from local code, but a long term solution is needed.

P.S
For reference, I found this after writing the issue. I understand the timeout was explicit, but in that case it means the parent shouldn't exit until all received messages have been handled and displayed.
e4000cf

@christian-bromann
Copy link
Contributor

I never experienced this. Can you help and provide a reproducible example or an environment where this is reproducible?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants