Babel 7 + Jest results in timeout


#1

I’m upgrading a React project from Babel 6 to Babel 7 (and bumping the Jest in the process). My build is failing with the error:

Too long with no output (exceeded 10m0s)

I reran the build with SSH then used SSH to access the container. Once inside the container, I re-ran the test suite and it passed in under 2 minutes. How can I debug this and find whats causing the build/test runner to hang and then timeout?


#2

Which container are you using?


#3

Thanks for getting back to me.

I’m using circleci/node:8.9.4-browsers. I tried bumping to circleci/node:8.12-browsers but got the same failure. I also tried busting the restore_cache but that didn’t work either.

Sometimes but not all the time, some tests will fail with ENOMEM: not enough memory errors and weird errors where its trying to import things from the wrong module, for example

Cannot find module 'react-emotion' from 'expansion-panel.jsx'

  1 | import React, { Component } from "react"
> 2 | import styled from "react-emotion"
    | ^

In this case, it till gets hung up on something and times out after 10 minutes rather than failing when the tests are done.

I’m a little confused that if I ssh into the container, the tests run and pass as expected. I’m not quite sure what to make of that.


#4

Incase anyone runs into this, I was able to resolve this with --runInBand.

I realized my tests were running slowly and occasionally having weird memory errors and found this section of the Jest docs: https://jestjs.io/docs/en/troubleshooting.html#tests-are-extremely-slow-on-docker-and-or-continuous-integration-ci-server

Thanks for helping with this!

Edit: Circle CI provides 2 vCPUs so --maxWorkers=2 might give better performance than --runInBand


#5

jake’s resolution helped out with my problem as well.

Also made our tests run way faster in circle ci. Brought our 2+ minute testing down to 23sec.


#6

Glad it helped! I talked with Circle CI support a little more and they recommended using --max-workers=2 since they provide two vCPUs for each container. You could try that and you might even get a little better performance.


#7

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.