# Synthetic monitoring Timeout 30 seconds

**URL:** https://discuss.elastic.co/t/synthetic-monitoring-timeout-30-seconds/314367
**Category:** Synthetics
**Created:** [September 14, 2022, 5:44am UTC](https://discuss.elastic.co/t/synthetic-monitoring-timeout-30-seconds/314367 "2022-09-14T05:44:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)
#### Post date: [September 14, 2022, 5:44am UTC](https://discuss.elastic.co/t/synthetic-monitoring-timeout-30-seconds/314367/1 "2022-09-14T05:44:46Z")

</div>

Hi, Im new to Synthetic monitoring, after a month of good results, a couple of days ago the status of some of the monitors started to fail, with the error:

```auto
Error message
page.goto: Timeout 30000ms exceeded.

```

The inline script is basic just to log in in a page:

```auto
    inline:
      script: |-
        step("load homepage", async () => {
            await page.goto('https://client.page.cl/Login');
        });

```

I tried many things like adding waitUntil: networkidle, domcontentloaded

```auto
await page.goto('https://client.page.cl/Login', { waitUntil : "domcontentloaded"});

```

but It didnt work, then I tries 5 minutes of timeout and startet working again.

```auto
await page.goto('https://client.page.cl/Login', {timeout:300000});

```

But this is not the proper solution, I imagine.

How can I solve this?

and another related question, the webpage runs fast and well when is loaded in my browser, so I was thinking that some content is already in the cache of my browser? and every time heartbeat and playwright go to the webpage start from zero?

and script (client.page.cl/themes/angulr/libs/jquery/jquery/dist/jquery.js) and an image seems to take too long to load  
 ![demora2](https://us1.discourse-cdn.com/elastic/original/3X/f/4/f4a5ca8ec71bfe0429eea3fb55947e67b85c35c0.png)

Version 7.17.5  
Thanks!

---

<div class="post-metadata">

### Author: ![abdulz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdulz/32/97601_2.png) [@abdulz](https://discuss.elastic.co/u/abdulz)
#### Post date: [September 14, 2022, 4:05pm UTC](https://discuss.elastic.co/t/synthetic-monitoring-timeout-30-seconds/314367/2 "2022-09-14T16:05:47Z")

</div>

Hi @ElasticLiver,

The time a page takes to load is a test aspect itself, so by default all assertions timeout and fail when they exceed `30s`, which could be overridden by `, { timeout: <ms> }` as you already discovered.

If that's not desirable, you can disable the timeout by providing `0` to an assertion e.g.

```auto
await page.goto('<url>', { timeout: 0 });

```

**Tip:**  
Use `timeout` and `waitUntil` params together with `page.goto` e.g.

```auto
await page.goto('<url>', { timeout: 0, waitUntil: 'load' }); // If you care to capture page's screenshot

await page.goto('<url>', { timeout: 0, waitUntil: 'domcontentloaded' }); // If you don't care page's screenshot

await page.goto('<url>', { timeout: 0, waitUntil: 'commit' }); // If you just want to make sure page is accessible over the URL

```

**Regarding resources taking long to load**  
It's true that a synthetics test opens a webpage in a blank session, so there are no cached resources, making a test slower compared to normal browsing. But there could be another aspect to it, depending on the version, _Network_ may be throttled by default in a test browser session. You can confirm that by disabling the throttling by providing `throttling: false` e.g.

```auto
  ...
  schedule: '@every 10m'
  throttling: false
  source:
    inline:
      script: |-
        ...

```

_ **Note** _ this may or may not work depending on the version, you can confirm the results and try updating to newer version. Let us know if you need further assistance with this.

**What's new**  
Creating browser monitors have become so much fun in the newer versions of Elastic Stack with [Project Monitors](https://www.elastic.co/guide/en/observability/master/synthetic-run-tests.html#synthetic-monitor-choose-project) where a browser journey could be authored and managed in an editor inside a project setup with all the tooling available. Then monitor's configuration such as **throttling** params could be viewed in Kibana GUI. Project monitors, defined once, could then be run hassle free on [Elastic managed infrastructure](https://www.elastic.co/guide/en/observability/master/uptime-set-up-choose-agent.html#global-managed-testing-infrastructure) or on premises using [Private Locations](https://www.elastic.co/guide/en/observability/master/uptime-set-up-choose-agent.html#private-locations). E.g. look [here](https://github.com/elastic/synthetics/issues/561#issuecomment-1215610563) to see how easy would it become to configure **timeout** per _step_, _journey_ or across the whole project.

If it sounds too much to read, just have a look at the [short video walkthrough](https://www.youtube.com/watch?v=lG4OcV314_k) about what's new in Synthetics.

---

<div class="post-metadata">

### Author: ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)
#### Post date: [September 14, 2022, 9:41pm UTC](https://discuss.elastic.co/t/synthetic-monitoring-timeout-30-seconds/314367/3 "2022-09-14T21:41:43Z")

</div>

It seem that in 7.17.5 throttling cant be set yet, but I follow your recommendations and its working.

Thanks four your help, and clear comments!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [October 8, 2022, 9:42pm UTC](https://discuss.elastic.co/t/synthetic-monitoring-timeout-30-seconds/314367/4 "2022-10-08T21:42:19Z")

</div>

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