Menu
Grafana Cloud
Troubleshoot Grafana Cloud k6
This topic describes common issues and how to resolve them when running performance tests in Grafana Cloud k6.
setup() times out
If your test fails before virtual users (VUs) start and the run shows a timeout during the setup phase, the setup() function did not complete within the allowed time.
What you might see
The test fails before any VUs start, and the logs contain errors similar to:
level=error msg="Error during setup() execution/propagation" error="Error executing setup: setup() execution timed out after 60 seconds"
level=error msg="Failed to run setup()" error="Error executing setup: setup() execution timed out after 60 seconds"The timeout duration in the message reflects the configured setupTimeout value (default 60s).
Common causes
setup()performs slow or blocking operations (for example, many sequential HTTP calls, large data processing, or external service waits).sleep()or long delays are used insetup(), so it runs longer than the timeout.- The script sets a high
setupTimeoutin options, but in Grafana Cloud k6, the maximum supported value is 10 minutes; any higher value is limited to 10 minutes. This limit is enforced server-side, is independent of VU quotas or subscription limits, and applies to all Grafana Cloud k6 users. It can’t be changed per subscription or organization.
How to fix it
- Shorten setup work: Move non-essential work out of
setup()(for example, do it in init or in the VU code if acceptable). Keepsetup()limited to what must run once before the test, such as fetching shared test data or starting a test environment. - Avoid or minimize
sleep()in setup: Usesleep()only when necessary insetup(); long sleeps can cause setup to exceed the timeout. Refer to Test lifecycle and sleep(). - Restructure long-running setup logic: If
setup()genuinely needs more than 10 minutes, move expensive work to an external process or a warm-up scenario. Pass the results to your test through a file or environment variable. - Use a shorter timeout to fail fast: If setup should complete quickly, set a lower
setupTimeout(for example,'30s') to surface problems sooner. - Check project and platform limits: The setup timeout is independent of VU or duration quotas. For other limits, refer to Manage project limits and quotas.
For more information, refer to the setupTimeout option reference and the test lifecycle documentation.
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video

Getting started with managing your metrics, logs, and traces using Grafana
In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.
Video

Intro to Kubernetes monitoring in Grafana Cloud
In this webinar you’ll learn how Grafana offers developers and SREs a simple and quick-to-value solution for monitoring their Kubernetes infrastructure.
Video

Building advanced Grafana dashboards
In this webinar, we’ll demo how to build and format Grafana dashboards.
Choose a product
Scroll for more