Search code examples
jestjsgitlabtimeoutpipeline

Why Jest cases takes much more time to run inside the Gitlab pipeline (Throw a timeout error inside pipeline)?


When I run test cases in local. All the test cases are completed within time limit(5000). But, When I run those test cases in gitlab pipeline then it will consume more time.

I use gitlab version 10.


Solution

  • I resolved this issue by

    1. identify and close the open handlers by --detectOpenHandles.
    2. Divide the test cases in chunks using --matchPathPattern and run those chunks parallel in GitLab pipeline. Generate separate coverage reports and merge using Istanbul-merge.