Skip to content

How to aggregate Multi thread process execution in one launch

Dmitriy Gumeniuk edited this page Dec 3, 2019 · 5 revisions

Overview

Starting version 5 Report Portal Client supports multi-process launch enabled by default. The feature joins reporting from every Report Portal Client running on a single physical or virtual machine into one launch. The feature uses file system to synchronize.

Configuration

These properties are responsible for the feature control in the reportportal.properties file. All of the are optional, so that means if a client doesn't find them it will use default values.

The feature is enabled by default.

Property name Type Default value Description
rp.client.join Boolean true Enable / Disable multi-process launch join mode
rp.client.join.lock.file.name String reportportal.lock A name of a main lock file, can be an absolute path. A client which managed to obtain that lock count itself as a primary launch process. It rewrites synchronization file with its launch ID.
rp.client.join.sync.file.name String reportportal.sync A name of a launch ID synchronization file, can be an absolute path. Each client waits for a lock on that file to get a launch ID (first line) and write its own ID to the end of the file.
rp.client.join.file.wait.timeout.ms Integer 60000 A synchronization file wait timeout in milliseconds.

Implementation logic

Sequence diagram

title Parallel run locking

Thread 1->reportportal.sync:Create+Write
Thread 1<--reportportal.sync: File lock
Thread 1->reportportal.lock:Create+Write
Thread 1<--reportportal.lock: File lock
Thread 2-#redxreportportal.sync:Create+Write\n\nerror: File already exists
Thread 1->Thread 1: Generate UUID
Thread 2->Thread 2: Poll 'reportportal.sync'
Thread 1->reportportal.sync:File clean
Thread 1->reportportal.sync:Write Launch / Thread UUID
Thread 1<--reportportal.sync:Release lock
Thread 2->reportportal.sync: Write lock
Thread 2<--reportportal.sync: File lock
Thread 2<--reportportal.sync:Read Launch UUID
Thread 2->reportportal.sync:Write Thread ID
Thread 2<--reportportal.sync: Release lock
rbox over Thread 2,Thread 1: Launch passed
Thread 1->reportportal.sync:Write lock
Thread 2-#redxreportportal.sync:Write lock\n\nerror: File already locked
Thread 2->Thread 2: Poll 'reportportal.sync'
Thread 1->reportportal.sync:Remove self Thread ID
Thread 1<--reportportal.sync:Release lock
Thread 1<--reportportal.lock:Release lock
Thread 1->reportportal.lock:Remove file
Thread 2->reportportal.sync: Write lock
Thread 2->reportportal.sync:Remove self Thread ID
alt There are no Thread IDs left
Thread 2->reportportal.sync: Remove file
else Still contains other Thread IDs
Thread 2<--reportportal.sync: Release lock
end