Bitbucket pipeline fails due to Build Technology and Test Framework

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

There are 2 scenarios:

  1. Network connection issue while installing packages with Yarn with one of the following errors in the build log:

    1 2 3 error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/core/-/core-4.11.3.tgz: ESOCKETTIMEDOUT". info There appears to be trouble with your network connection. Retrying... "ENOENT: no such file or directory"
  2. Gradle Tests show the following error in the build log:

    1 2 org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not complete execution for Gradle Test

Solution

Scenario 1: Network connection issue while installing packages with Yarn with one of the following errors in the build log:

1 2 3 error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/core/-/core-4.11.3.tgz: ESOCKETTIMEDOUT". info There appears to be trouble with your network connection. Retrying... "ENOENT: no such file or directory"

Possible Causes:

  • Large package size

  • Slow network connection

  • Multiple concurrent package installation processes

Troubleshooting Steps:

Is there a Timeout error in the build logs (as mentioned below) while connecting to the yarn registry? Sometimes you may need to add verbose output to see additional build logs.

1 2 error An unexpected error occurred: "https://registry.yarnpkg.com/<package>: ESOCKETTIMEDOUT". info There appears to be trouble with your network connection. Retrying...

YES

  • The package that is being installed might be too large or the network connection might be too slow for the package/dependency to be downloaded with the default NETWORK_TIMEOUT is 30 seconds. Add --network-timeout parameter with a higher value to increase the timeout period. For example, to increase the timeout to 300,000 milliseconds (5 minutes):

    1 yarn add <yourPackage> --network-timeout 300000
  • Does yarn install fail with the following error?

    1 "ENOENT: no such file or directory"

YES

  • By default, yarn allows 50 concurrent requests. We can configure yarn to install packages sequentially instead. Add --network-concurrency 1 to yarn install command. For example:

    1 yarn install --network-concurrency 1

NO

Scenario 2: Gradle Tests show the following error in the build log:

1 2 org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not complete execution for Gradle Test

Possible Causes:

  • JVM for the worker process is running out of memory.

  • When you are using Gradle to run tests, there are two main processes, which are Gradle Daemon and Gradle worker process. The daemon and worker handle JVM memory allocation separately.

Troubleshooting Steps:

Add --stacktrace or --debug to your Gradle test command.

Is the JVM returning the following out of memory error (OutOfMemoryError)?

1 2 3 4 org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not complete execution for Gradle Test [DEBUG] [TestEventLogger] java.lang.OutOfMemoryError: Java heap space

YES

  • By default, the Gradle worker has a maxHeapSize of 512m, which has been exceeded by the test execution.

  • To solve this, you could try to increase JVM’s memory allocation for the worker/test to a higher value by setting it in the tests config maxHeapSize Gradle Test page.

NO

Updated on March 26, 2025

Still need help?

The Atlassian Community is here for you.