webdriverio-community / wdio-video-reporter

Reporter for WebdriverIO that makes videos of failed tests and has optional allure integration

Home Page:https://webdriver.io/docs/wdio-video-reporter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When starting the autotest, an unknown error periodically occurs, which causes the test to crash

LikaKse opened this issue · comments

Describe the bug
A failing test sometimes causes wdio-video-reporter to crash.

Stdout

#0 0x5556f34f7ee3 <unknown>
#1 0x5556f2fc5608 <unknown>
#2 0x5556f2fb5e83 <unknown>
#3 0x5556f2fa9779 <unknown>
#4 0x5556f3038aa9 <unknown>
#5 0x5556f3019272 <unknown>
#6 0x5556f302c3bc <unknown>
#7 0x5556f3019163 <unknown>
#8 0x5556f2feebfc <unknown>
#9 0x5556f2fefc05 <unknown>
#10 0x5556f3529baa <unknown>
#11 0x5556f353f651 <unknown>
#12 0x5556f352ab05 <unknown>
#13 0x5556f3540a68 <unknown>
#14 0x5556f351f05f <unknown>
#15 0x5556f355b818 <unknown>
#16 0x5556f355b998 <unknown>
#17 0x5556f3576eed <unknown>
#18 0x7f31f512dfa3 <unknown>
    at Video.emit (node:events:381:22)
    at Video.emit (node:domain:470:12)
    at Array.forEach (<anonymous>)

To Reproduce
video reporter
npx wdio run wdio.conf.js

Expected behavior

  • video record in allure report
  • failing test stack trace in allure report

Actual behavior

  • empty video record
  • unexpected stack trace

Environment

  • wdio-video-reporter version: 3.2.0
  • WebdriverIO version:7.5.2
  • Mode: jasmine
  • If WDIO Testrunner, running: sync

Desktop (please complete the following information):

  • OS: docker node:15.14.0-buster
  • Browser chrome
  • Version 96.0.4664.55

Additional context

Can you provide some sort of reproducible example? As you can see this log doesn't help at all to guess where a bug might be located. Could be this library or your environment. Without more information it will be impossible to investigate this problem.

I'm running tests in a docker container.

I reproduced the environment in a new project https://github.com/LikaKse/wdio-template .
Without the tested site located on the local network, I can't reproduce the error.
I managed to collect more logs.
stdout.txt
wdio-0-0-Video-reporter.log
What other information could be useful to you?

Thanks for providing the information. I currently don't have much time to look into this but if anyone can help to investigate, this would be much appreciated!

Exception generated by browser.saveScreenshot at index.js#L113 was not handled by "try catch" block, that leads to whole promise chain fails with warnings:

[0-0] (node:541) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
[0-0] (node:541) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 3)

I replaced "try catch" statement with ".catch(()=>{})" and sent a patch to @LikaKse
So we can catch an actual error:

Got exception "unknown error: cannot activate web view
  (Session info: headless chrome=96.0.4664.110)"
#0 0x55fc304a7ee3 <unknown>
#1 0x55fc2ff75608 <unknown>
#2 0x55fc2ff65e83 <unknown>
#3 0x55fc2ff59779 <unknown>
#4 0x55fc2ffe8aa9 <unknown>
#5 0x55fc2ffc9272 <unknown>
#6 0x55fc2ffdc3bc <unknown>
#7 0x55fc2ffc9163 <unknown>
#8 0x55fc2ff9ebfc <unknown>
#9 0x55fc2ff9fc05 <unknown>
#10 0x55fc304d9baa <unknown>
#11 0x55fc304ef651 <unknown>
#12 0x55fc304dab05 <unknown>
#13 0x55fc304f0a68 <unknown>
#14 0x55fc304cf05f <unknown>
#15 0x55fc3050b818 <unknown>
#16 0x55fc3050b998 <unknown>
#17 0x55fc30526eed <unknown>
#18 0x7fe2fbf6bfa3 <unknown>
    at Browser.<anonymous> (/e2e/node_modules/@wdio/utils/build/shim.js:270:24)
    at Video.onAfterCommand (/e2e/node_modules/wdio-video-reporter/src/index.js:113:9)
    at Video.emit (node:events:381:22)
    at Video.emit (node:domain:470:12)
    at /e2e/node_modules/@wdio/runner/build/reporter.js:36:56
    at Array.forEach (<anonymous>)
    at BaseReporter.emit (/e2e/node_modules/@wdio/runner/build/reporter.js:36:25)
    at EventEmitter.<anonymous> (/e2e/node_modules/@wdio/runner/build/index.js:209:82)

@christian-bromann can you take a closer look at this "try catch" statements index.js#L111 index.js#L171 ? Why them don't catch an exception in a desired way?

"unknown error: cannot activate web view" fixed by increasing the resources available to the container and setting the following arguments to chrome:

        args: ["window-size=1920,1080",
               "--headless",
               "--no-sandbox",
               "--disable-gpu",
               "--disable-extensions",
               "--dns-prefetch-disable",
               "--disable-infobars",
               "--disable-browser-side-navigation",
               "--disable-dev-shm-usage"
              ],

Thank @ginta1337 for your help in debugging