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

testcafe live mode fails after first rerun #3322

Closed
joma74 opened this issue Jan 18, 2019 · 6 comments
Closed

testcafe live mode fails after first rerun #3322

joma74 opened this issue Jan 18, 2019 · 6 comments
Assignees
Labels
AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: live mode TYPE: bug The described behavior is considered as wrong (bug).
Milestone

Comments

@joma74
Copy link

joma74 commented Jan 18, 2019

Rerun in new integrated live mode exits process with failure and stacktrace

Warnings (4):
 --
  The file at
  "/home/joma/entwicklung/design/inetingishard/floats/target/reports/screenshots/actual/Index_Page_Test/dom_has_critical_elements/HeadlessChrome_71.0.3578_Linux_0.0.0/scsh_1.png"
  already exists. It has just been rewritten with a recent screenshot. This situation can possibly cause issues. To avoid them,
  make sure that each screenshot has a unique path. If a test runs in multiple browsers, consider including the user agent in
  the screenshot path or generate a unique identifier in another way.
 --
 ...
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at writeAfterEnd (_stream_writable.js:243:12)
    at WriteStream.Writable.write (_stream_writable.js:291:5)
    at ReporterPluginHost.write [as newline] (/home/joma/entwicklung/design/inetingishard/floats/node_modules/testcafe/src/reporter/plugin-host.js:108:22)
    at ReporterPluginHost.reportTaskDone (/home/joma/entwicklung/design/inetingishard/floats/node_modules/testcafe-reporter-xunit/lib/index.js:84:67)
    at reportTaskDone (/home/joma/entwicklung/design/inetingishard/floats/node_modules/testcafe/src/reporter/index.js:176:31)
    at Generator.next (<anonymous>)
    at step (/home/joma/entwicklung/design/inetingishard/floats/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/joma/entwicklung/design/inetingishard/floats/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (/home/joma/entwicklung/design/inetingishard/floats/node_modules/core-js/library/modules/_export.js:36:28)
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at writeAfterEnd (_stream_writable.js:243:12)
    at WriteStream.Writable.write (_stream_writable.js:291:5)
    at ReporterPluginHost.write [as newline] (/home/joma/entwicklung/design/inetingishard/floats/node_modules/testcafe/src/reporter/plugin-host.js:108:22)
    at ReporterPluginHost.reportTaskDone (/home/joma/entwicklung/design/inetingishard/floats/node_modules/testcafe-reporter-xunit/lib/index.js:84:67)
    at reportTaskDone (/home/joma/entwicklung/design/inetingishard/floats/node_modules/testcafe/src/reporter/index.js:176:31)
    at Generator.next (<anonymous>)
    at step (/home/joma/entwicklung/design/inetingishard/floats/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/joma/entwicklung/design/inetingishard/floats/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (/home/joma/entwicklung/design/inetingishard/floats/node_modules/core-js/library/modules/_export.js:36:28)
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at writeAfterEnd (_stream_writable.js:243:12)
    at WriteStream.Writable.write (_stream_writable.js:291:5)
    at ReporterPluginHost.write [as newline] (/home/joma/entwicklung/design/inetingishard/floats/node_modules/testcafe/src/reporter/plugin-host.js:108:22)
    at ReporterPluginHost.reportTaskDone (/home/joma/entwicklung/design/inetingishard/floats/node_modules/testcafe-reporter-xunit/lib/index.js:84:67)
    at reportTaskDone (/home/joma/entwicklung/design/inetingishard/floats/node_modules/testcafe/src/reporter/index.js:176:31)
    at Generator.next (<anonymous>)
    at step (/home/joma/entwicklung/design/inetingishard/floats/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/joma/entwicklung/design/inetingishard/floats/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (/home/joma/entwicklung/design/inetingishard/floats/node_modules/core-js/library/modules/_export.js:36:28)
error Command failed with exit code 1.

What is your Test Scenario?

develop in live mode

What is the Current behavior?

fails after first rerun

What is the Expected behavior?

no failure after first rerun

What is your web application and your TestCafe test code?

https://github.com/joma74/inetingishard-floats/commits/testcafelivemodefails

https://github.com/joma74/inetingishard-floats/blob/7303517c1652f69df4aa3b85e8578ede6d90c3a5/src/tests/index-test.js

Steps to Reproduce:

  1. yarn install
  2. first terminal yarn run start
  3. second terminal yarn run testcafe-live
  4. test failures are expected(as of now 😳)
  5. Press CTRL-r
  6. Process exits with failure and stacktrace

Your Environment details:

  • testcafe version: 1.0.0-alpha.2
  • node.js version: 10.13.0
  • command-line arguments: testcafe 'firefox:headless,chrome:headless --no-sandbox --disable-gpu' -L -S -s $npm_package_config_screenshots -p $npm_package_config_screenshot_path_pattern -r spec,xunit:$npm_package_config_reports/report.xml src/tests/index-test.js
  • browser name and version: Chrome 71.0.3578.98-1 Firefox 64.0+build3-0ubuntu0.16.04.1
  • platform and version: Ubuntu 16.04.5 LTS
  • other:
@joma74
Copy link
Author

joma74 commented Jan 18, 2019

Can you also make up a configuration for the absence of above logs of warnings? While technically and DX-related totally sensible, maybe a certain log filter level (screenshottaker.fileoverwrite.occured=OFF) set via config/env or cli helps in reducing terminal distraction.

@joma74
Copy link
Author

joma74 commented Jan 19, 2019

As i see it now - removing xunit reporter(cause of above failure) in testcafe-live mode is a viable solution for me.

P.S. After short testing, integrated Live Mode works stable. Only that is does not catch up changes to my index-test.js file. Have to do manually CTRL + r.

@Farfurix
Copy link
Contributor

Hello, @joma74.
Thank you for the detailed description. Unfortunately, I can't pass all the reproducing steps. Could you help me resolve this error at the second step (run start command)?

start command error:

run start
yarn run v1.13.0
...
Project is running at http://0.0.0.0:8080/
webpack output is served from /
Child
webpack: Failed to compile.
    
    ERROR in   TypeError: Converting circular structure to JSON
      
      - JSON.stringify
      
      - index.js:301 HtmlWebpackPlugin.postProcessHtml
        [inetingishard-floats]/[html-webpack-plugin]/index.js:301:76
      
      - index.js:188 applyPluginsAsyncWaterfall.then.result
        [inetingishard-floats]/[html-webpack-plugin]/index.js:188:34
      
      - next_tick.js:68 process._tickCallback
        internal/process/next_tick.js:68:7

I tried to update the html-webpack-plugin package to the 4.0.0-beta.5 version and used chunksSortMode: 'none', but it didn't help.

Environment details:

  • Windows 10

@Farfurix Farfurix added the STATE: Need clarification An issue lacks information for further research. label Jan 21, 2019
@joma74
Copy link
Author

joma74 commented Jan 29, 2019

Hey @Farfurix, hope i have things sorted out. It's the Windows OS 😄 vs Unix(my bread and butter OS), with all their beautiful different path separators, among other things. As in the regex of webpack config - which is still strict webpack 3 - describing a file path to exclude the acitvition of a plugin, which resulted in the above error.

I tested under Windows 10, although only inside git bash. Which i must call out for as a prerequisite to use the application. Any other than this, i expect the application to run with the commands described above. I can still see the error Error [ERR_STREAM_WRITE_AFTER_END]: write after end... from the issue description.


P.S. I spent a good part of my free time the last days to get this build run on windows on travis. That offer is in beta and around since October 2018(Windows Server 2016, shell is git bash). Learned Firefox as addon is not supported, but may be installed via chocolatery, so i thought i woudl give it a go. But i cant get the Windows build to run. Always ended with

ERROR Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.

as in https://travis-ci.org/joma74/inetingishard-floats/jobs/483337236

I think i narrowed it down to firefox. chrome only build was successful. If you hear of any "me also" or otherwise success stories about Travis Windows with firefox, leave me a note.

Sidestep - perhaps you can define above ERROR Unable to establish message more clearly if it's FF or chrome browser connection? Or maybe run a report on the good ones, but fail the overall result?

@no-response no-response bot removed the STATE: Need clarification An issue lacks information for further research. label Jan 29, 2019
@AndreyBelym AndreyBelym added TYPE: bug The described behavior is considered as wrong (bug). AREA: server SYSTEM: live mode labels Jan 30, 2019
@AndreyBelym AndreyBelym added this to the Planned milestone Jan 30, 2019
@AndreyBelym
Copy link
Contributor

Thank you for the provided information. I was able to reproduce the error with the Error [ERR_STREAM_WRITE_AFTER_END] error on Ubuntu 18.04 and added it to our roadmap. I'll post a message in this thread to notify you when a build with a fix is released.

However, TestCafe has always restarted tests after I made changes in the test file and saved them with the Vi editor. If you still can reproduce the problem, could you create a new issue and specify your text editor and filesystem type (ext4,zfs, btrfs, etc.) there?

About your P.S.: I haven't tried Windows machines provided by Travis CI yet, but we run Firefox Headless on Linux by TravisCI and looks like that the Firefox Electrolysis is not compatible with the Travis CI build runner. We disable it by using the special firefox:headless:disableMultiprocessing=true option, maybe it will help you on Windows too.

By the way, it looks like a subject for another issue, so please create a new one if you want to continue discussing Firefox on Travis CI.

@AndreyBelym AndreyBelym modified the milestones: Planned, Sprint #27 Feb 8, 2019
@AlexKamaev AlexKamaev self-assigned this Feb 8, 2019
AlexKamaev added a commit to AlexKamaev/testcafe that referenced this issue Feb 11, 2019
@lock
Copy link

lock bot commented Mar 27, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.

@lock lock bot added the STATE: Auto-locked An issue has been automatically locked by the Lock bot. label Mar 27, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2019
kirovboris pushed a commit to kirovboris/testcafe-phoenix that referenced this issue Dec 18, 2019
…press#3426)

* [WIP] do not dispose reporters in Live Mode (closes DevExpress#3322)

* [WIP]dispose assets in Live mode only after run is finished (closes DevExpress#3322)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AREA: server STATE: Auto-locked An issue has been automatically locked by the Lock bot. SYSTEM: live mode TYPE: bug The described behavior is considered as wrong (bug).
Projects
None yet
Development

No branches or pull requests

4 participants