Skip to main content
Version: 26.1

Retries reporting

important

Starting from ReportPortal 26.1, reporting API endpoints use project key (projectKey) instead of project name.

You can find the project key in Project settings → General.

Some frameworks allow to retry Test execution according to provided conditions (TestNG) or just retry it predefined number of times. First execution is a simple TestItem and next ones are called Retries. In ReportPortal these items are grouped and displayed as a sequence of executions for the same Test:

To find retries in ReportPortal, first click the launch that contains retries.

Then, go to the Step level.

When you click on the retries link you can switch between Retries and see their logs:

On the Log page of test item you can also switch between Retries:

Retries reporting​

Common child Test item request (check reporting dev guide) looks like:

curl --header "Content-Type: application/json" \
--header "Authorization: Bearer 039eda00-b397-4a6b-bab1-b1a9a90376d1" \
--request POST \
--data '{"name":"example step","startTime":"1574423237000","type":"step","launchUuid":"<launch uuid>","description":"Item that should be retried"}' \
http://rp.com/api/v1/rp_project/item/<parent uuid>

With body:

{
"name": "example step",
"startTime": "1574423237000",
"type": "step",
"launchUuid": "<launch uuid>",
"description": "Item that should be retried"
}

And response:

{
"id": "uuid-of-the-first-step",
"uniqueId": "auto:cd5a6c616d412b6739738951c922377f"
}

Request for a retry looks the same, but has field retry=true:

{
"name": "example step",
"startTime": "1574423237100",
"type": "step",
"launchUuid": "<launch uuid>",
"description": "Item that should be retried",
"retry": true
}

Alternatively, you can point to a specific previous attempt with retryOf (UUID of that item):

{
"name": "example step",
"startTime": "1574423237100",
"type": "step",
"launchUuid": "<launch uuid>",
"description": "Item that should be retried",
"retryOf": "uuid-of-the-first-step"
}

Retries handling is triggered if the start request has retry=true or a non-empty retryOf.

There are two matching modes:

  • Implicit (retry=true, no retryOf): the system groups active items that share the same uniqueId and parentId. If you provide uniqueId explicitly, it must match the previous attempt; otherwise ReportPortal generates it. Items with different uniqueId under the same parent are not grouped as retries.
  • Explicit (retryOf set): the new item is linked to the item with that UUID. If the UUID is not found, the system falls back to implicit matching.

Root (suite-level) items cannot be reported as a retry — the API rejects retry=true / retryOf on a root item.

Order of requests​

Retries handling triggered only if Test item has retry=true (or retryOf) in the request. For example:

First request will trigger retries handling, but if it's the first reported Test item it won't be a retry:

{
"name": "example step",
"startTime": "1574423237100",
"type": "step",
"launchUuid": "<launch uuid>",
"description": "Item that should be retried",
"retry": true
}

Second request won't trigger retries handling, because retry=false is specified (or this field isn't provided) in the request:

{
"name": "example step",
"startTime": "1574423237100",
"type": "step",
"launchUuid": "<launch uuid>",
"description": "Item that should be retried",
"retry": false
}

As a result 2 separate Test items will be displayed, so ORDER of sent requests matters (if send this items in reversed order they will be grouped as retries).

Which item keeps statistics​

In ReportPortal only one item in a retries group stays in the launch tree as the main item (keeps path, statistics, and can have an issue). Other attempts become retries.

  • Implicit mode: the main item is the one with the latest startTime among matching items.
  • Explicit mode (retryOf): the newly reported item becomes the main item; the targeted previous attempt is demoted to a retry.

In the examples above, startTime was 1574423237000 for the first item and 1574423237100 for the second one, so in implicit mode the second one is the main Test Item with statistics and issue (if attached).