question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting `error Command failed with exit code 1.` in random while executing the tests.

See original GitHub issue

What is your Scenario?

I am running a set of tests within a folder. These tests contain,

  • UI clicks
  • UI navigation
  • File upload scenario
  • Assertions

No other special scenarios tested in this suite.

What is the Current behavior?

All the tests are getting passed but then I am getting the error as error Command failed with exit code 1.

testcafe -q attemptLimit=2,successThreshold=1 --test-meta QUARANTINED=false src/tests/ -r spec,allure-extended,junit:reports/tc-report.xml -c 2
The "src", "reporter", and "filter" options from the configuration file will be ignored.
 Running tests in:
 - Chrome 96.0.4664.45 / Linux 0.0

..
..
..

 5 passed (5m 08s)
 Warnings (1):
 --
  The "src", "reporter", and "filter" options from the configuration file
  will be ignored.
Error: 
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

We are not getting a failure report or error log trace to fix our code, just the error code. The main problem is this is not happening on every execution. We are getting this in random.

What is the Expected behavior?

If there is a failure, we are expecting it to throw what is the failure along with an error trace, so that we can take a look at how to fix the issue.

What is your public website URL? (or attach your complete example)

As I mentioned earlier, since it’s happening at random, we could not get a solid code or public URL to replicate the same. It would be great if we could get a debug build as we got https://github.com/DevExpress/testcafe/issues/4665#issuecomment-579138984 in this issue so that we could use that in our runs and report when we could get this issue in random.

What is your TestCafe test code?

Here we are running multiple tests across multiple files. Also If we run the tests individually we couldn’t get this issue. So I couldn’t decide on which test code to actually put here.

Your complete configuration file

{
  "src": "./src/tests/**/*.js",
  "browsers": [
    "chrome:headless:emulation:width=1366;height=800; --test-type --disable-accelerated-video --disable-accelerated-plugins --disable-accelerated-layers --disable-accelerated-compositing --disable-accelerated-2d-canvas --disable-web-security --allow-running-insecure-content --dev --allow-insecure-localhost --ignore-certificate-errors --disable-dev-shm-usage --disable-gpu --autoplay-policy=no-user-gesture-required --disable-infobars --use-fake-ui-for-media-stream --allow-running-insecure-content --use-fake-device-for-media-stream --use-file-for-fake-video-capture=$PWD/src/support/fixtures/files/jellyfish.y4m --use-file-for-fake-audio-capture=$PWD/src/support/fixtures/files/noise_16.wav"
  ],
  "quarantineMode": {
    "successThreshold": 1,
    "attemptLimit": 2
  },
  "concurrency": 2,
  "ajax-request-timeout": 90000,
  "page-request-timeout": 90000,
  "page-load-timeout": 90000,
  "selectorTimeout": 60000,
  "selector-timeout": 60000,
  "browser-init-timeout": 60000,
  "assertionTimeout": 60000,
  "speed": 0.8,
  "skipJsErrors": true,
  "skipUncaughtErrors": true,
  "hostname": "localhost",
  "screenshots": {
    "path": "./artifacts/screenshots/",
    "takeOnFails": true,
    "pathPattern": "${DATE}/${TEST}_${RUN_ID}.png",
    "fullPage": false
  },
  "reporter": [
    {
      "name": "spec"
    },
    {
      "name": "allure-extended"
    },
    {
      "name": "junit",
      "output": "reports/report.xml"
    }
  ]
}

Your complete test report

No response

Screenshots

No response

Steps to Reproduce

TestCafe version

1.17.1

Node.js version

v14.17.5

Command-line arguments

testcafe -q attemptLimit=2,successThreshold=1 --test-meta QUARANTINED=false src/tests/ -r spec,allure-extended,junit:reports/tc-report.xml -c 2

Browser name(s) and version(s)

Chrome 96.0.4664.45

Platform(s) and version(s)

Linux 0.0

Other

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
bbutelcommented, Dec 28, 2021

+1 on my side. It happens ramdomly and I don’t have a specific use case. In my context, runs are done in a docker component.

1reaction
miherlosevcommented, Jan 7, 2022

Hi @naresh-hopin

Collecting logs sometimes can help find the cause of the issue. In your case, unfortunately, it didn’t. I will close the issue because we still don’t have a simple example that we can run locally. Feel free to reopen this issue if you can share such an example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build command failed with exit code 1 - Netlify Support Forums
I have build errors which i didn't have before in previous deploys, although my webpack config hasn't changed. Also my previous deploys ...
Read more >
error Command failed with exit code 1. when I try to run yarn
Try executing following commands in your project root folder: yarn install and yarn start. In case if the above approach didn't help: Try...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Native debugger crashes with "Debugger process finished with exit code 127" ... This error occurs on Linux-based platforms when starting the native debugger....
Read more >
Learn Bash error handling by example | Enable Sysadmin
An exit status of zero indicates success. A non-zero exit status indicates failure. When a command terminates on a fatal signal N, bash...
Read more >
Groovy error for custom code while running from command line
While running Katalon test cases from the command line, I'm getting random (very random) failures that return exit code 2 which I believe...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found