Documentation

Looking for something in particular?

Automation V3: How to Enable Watchdog Recovery for Frozen Test Runs

Watchdog recovery, also called stalled run recovery, is a safety net for command-line test runs. If a test run stalls and stops producing log output, Provar logs a warning, cancels the run, and, if the process is still unresponsive, exits it, so your pipeline does not wait for hours. This article explains what watchdog recovery does, when to enable it, and how to tune it for your suite.

Note: Watchdog recovery and stalled run recovery are the same feature. The watchdog is the component that detects the stall. A stalled run is a test run that is still open but has produced no log output for longer than the stall timeout. The settings use the word stall, as in

com.provar.watchdog.stallTimeoutMs.

Fastest path: Enable watchdog recovery with the default settings by adding com.provar.watchdog.enabled=true to your properties file. Nothing else in this article is required to get protection.

What Watchdog Recovery Does

Long or parallel browser suites occasionally freeze. A browser stops responding, a page never finishes loading, or a driver call never returns. Without protection, that one frozen test blocks the whole run. Nothing intervenes until an external job timeout kills the run, often hours later, and you have no record of what passed and what did not.

Watchdog recovery watches for silence in the log. If a test produces no output for longer than the stall timeout, Provar treats the run as stalled and responds in three stages: it logs a warning, it cancels the test run, and, if the process still does not respond, it exits the process.

Results are written incrementally rather than all at once at the end of the run. Every test that finished before the freeze still appears in the report, so an interrupted run is still useful.

When to Enable Watchdog Recovery

Watchdog recovery is off by default. Enabling it is a judgment call, not a universal setting.

Enable it when

  • Runs are unattended, such as nightly builds or scheduled pipelines that nobody is watching.
  • Tests run in parallel, or in headless or continuous integration (CI) browsers, where a single frozen session is easy to trigger and easy to miss.
  • The environment has a history of intermittent hangs, such as flaky networks, remote grids, or resource-constrained agents.
  • You would rather have partial results from an interrupted run than no results at all.

Leave it off, or retune it, when

  • You are running a short suite locally and watching it. In that case you may prefer to see the hang yourself rather than have the run cancelled automatically.
  • A test step is known to stay quiet for a long time, such as a long setup step or a slow batch import. Raise the stall timeout instead of leaving watchdog recovery off.

Before You Begin

  • Your tests run from the command line. Watchdog recovery and incremental result writing do not apply to interactive runs in Provar Desktop.
  • You can edit a provar.properties file, or pass a command-line argument to the run.

Note: Watchdog recovery is available in Provar version 3.0.8 and newer.

How to Enable Watchdog Recovery

Use these steps to enable watchdog recovery for every run on the machine. This is the simplest option for most users.

Step 1: Open the properties file at ~/Provar/.properties/provar.properties in a text editor. If the file does not exist, create it.

Step 2: Add the following line:

com.provar.watchdog.enabled=true

Step 3: Save the file and start your test run from the command line.

Watchdog recovery is now active with the default stall timeout of five minutes.

Step 4 (optional): If five minutes does not suit your suite, add the stall timeout in milliseconds. The following line sets the timeout to 10 minutes:

com.provar.watchdog.stallTimeoutMs=600000

Settings

Only the first setting is required. The second is for suites whose normal pace does not match the default.

SettingDefaultPurpose
com.provar.watchdog.enabledfalseTurns watchdog recovery on. Values: true or false. It stays off unless you set this value.
com.provar.watchdog.stallTimeoutMs300000 (five minutes)How long a test can run without log output before the run is treated as stalled. Value: whole number, in milliseconds. Optional.

For most suites, setting com.provar.watchdog.enabled to true is enough. Change the timeout only if five minutes does not suit your tests.

What Happens During a Stall

The table below shows the three stages at the default stall timeout of five minutes. Every stage scales with the value of com.provar.watchdog.stallTimeoutMs, so a longer timeout moves all three stages out proportionally.

ElapsedStageWhat happens
2:30WarningProvar writes a warning line to the log. The test is still running. This is a heads-up, not an action.
5:00StopProvar cancels the test run. Most suites stop at this stage.
10:00ExitIf cancelling did not work, the command-line process exits on its own, so the pipeline is not left waiting.

Note: Tests that finished before the freeze are already written to the report, so you keep the results of the completed part of the run.

Where to Set the Property

You can set watchdog recovery properties in any of the four locations below. They are listed in priority order, highest first. The first value found wins, so a value set higher in this list overrides the same value set lower down.

1. Command-line argument

-Dcom.provar.watchdog.enabled=true

2. Provar user home, at <Provar user home>/.properties/provar.properties. On most machines this resolves to ~/Provar/.properties/provar.properties.

com.provar.watchdog.enabled=true

3. Test project folder, in provar.properties.

4. Provar installation folder, in provar.ini.

Simplest for most users: a single line in ~/Provar/.properties/provar.properties setting com.provar.watchdog.enabled=true.

Limitations

  • Watchdog recovery and incremental result writing apply to command-line test execution only.
  • The watchdog measures silence in the log, not test progress. A test step that runs for a long time without logging output is treated the same as a frozen one.
  • Only tests that finished before the freeze appear in the report. The frozen test and any tests that had not yet started are not reported as passed.

Related Articles


Feedback

Was this article helpful for you?
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top