DevExpress / testcafe-react-selectors

TestCafe selector extensions for React apps.
https://testcafe.io
MIT License
203 stars 43 forks source link

Maximum call stack size exceeded upon upgrading to testcafe 1.1.1 #141

Closed benaduggan closed 5 years ago

benaduggan commented 5 years ago

I recently upgraded our project to use a newer version of testcafe, and the getReact() call is now bombing out with a Call Stack exceeded error message. Any idea what might have cause this problem?

AlexKamaev commented 5 years ago

It's difficult to determine the cause of the issue based only on your description. We would really appreciate it if you provide a sample working project (or public url to your project). Please also specify your previous TestCafe version and your OS/Browser information

benaduggan commented 5 years ago

I'm not sure when I'll have time to set up a test project since our product is not OSS, but in the meantime I did figure out the test ran in 1.1.0, but not any version after. I'm on ubuntu 18.04 and ran with chrome 74, chrome:headless, and firefox 66 which all had the same issue. Is there any other browser/os information that y'all would like? I'll try to get back with a test project soon.

AlexKamaev commented 5 years ago

Thank you for your cooperation. This information is enough. We are looking forward to your project to research it.

bhoogter commented 5 years ago

We are also experiencing this issue with Chrome 75 and TestCafe 1.3.2 (on MacOS Mojave).

Reverting TestCafe via npm to 1.1.0 makes the tests pass.

The issue is very intermittent. We duplicated a one-line test some 20 times or so and kept re-running it. The test would fail in the beforeEach() in a different spot on a random test number, usually within 5-6 tests, but sometimes as many as ten. It would fail for about 3-4 tests, and then sometimes start working again. Suppressing javascript errors was not sufficient, since it caused the page to fail loading...

The before each is extremely simple (where dataQa() is a custom Selector()).....

.beforeEach(async t => { await t .useRole(userAdmin) .navigateTo(url) .click(dataQa('nav-drivers', 'li'))

And the test is...

function item() {return Selector('[data-qa=health-overview-heading]') } ... (repeated) test('Test 28', async t => { await t.expect(item().exists).ok()}) ... (repeated)

Error Trace while running TestCafe was:

  JavaScript error details:
 RangeError: Maximum call stack size exceeded
     at String.replace (<anonymous>)
     at a (http://xxx.xx.x.o:60230/hammerhead.js:15:26182)
     at o (http://xxx.xx.x.o:60230/hammerhead.js:15:26131)
     at g (http://xxx.xx.x.o:60230/hammerhead.js:15:27314)
     at value (http://xxx.xx.x.o:60230/hammerhead.js:5:25446)
     at Object.<anonymous> (http://localhost:8080/app.js:753:7)
     at __webpack_require__ (http://localhost:8080/app.js:654:38)
     at fn (http://localhost:8080/app.js:87:20)
     at eval (webpack-internal:///693:23:26)
     at Object.<anonymous> (http://localhost:8080/app.js:4959:1)
miherlosev commented 5 years ago

Hi @bhoogter

Could you please run TestCafe in development mode and provide us with the error stack again?

bhoogter commented 5 years ago

Sure. New to TestCafe here, so forgive the ignorance.

      JavaScript error details:
      RangeError: Maximum call stack size exceeded
          at String.replace (<anonymous>)
          at removeSourceMap (http://xxx.xx.x.o:62494/hammerhead.js:26472:21)
          at preprocess (http://xxx.xx.x.o:62494/hammerhead.js:26464:24)
          at processScript (http://xxx.xx.x.o:62494/hammerhead.js:26573:27)
          at value (http://xxx.xx.x.o:62494/hammerhead.js:9886:88)
          at Object.<anonymous> (http://localhost:8080/app.js:753:7)
          at __webpack_require__ (http://localhost:8080/app.js:654:38)
          at fn (http://localhost:8080/app.js:87:20)
          at eval (webpack-internal:///693:23:26)
          at Object.<anonymous> (http://localhost:8080/app.js:4959:1)

      Browser: Chrome 75.0.3770 / Mac OS X 10.14.5

         10 |
         11 |fixture('Health Landing Page')
         12 |    .beforeEach(async t => {
         13 |        await t
         14 |            .useRole(fcsAdmin)
       > 15 |            .navigateTo(`${url}`)
         16 |        await selectCustomer(t, 'DriverCustomer')
         17 |        await t
         18 |            .click(Selector(dataQa('nav-health', 'li')))
         19 |    });
         20 |

         at navigateTo (.../src/tests/health/health-page.js:15:14)
         at fixture.beforeEach (.../src/tests/health/health-page.js:11:1)
         at <anonymous> (.../node_modules/testcafe/src/api/wrap-test-function.js:17:28)
         at TestRun._executeTestFn (.../node_modules/testcafe/src/test-run/index.js:263:19)
         at TestRun._runBeforeHook (.../node_modules/testcafe/src/test-run/index.js:283:31)
         at TestRun.start (.../node_modules/testcafe/src/test-run/index.js:311:24)
miherlosev commented 5 years ago

I've created a bug in the testcafe-hammerhead module. Track it be informed about our progress.

Also, I will close this issue because the problem is not related to testcafe-react-selectors module.