Skip to content
This repository was archived by the owner on Dec 18, 2019. It is now read-only.
This repository was 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

@ckm2k1

Description

@ckm2k1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions