testRTC allows you to share key/value pairs between the probes in the same test run. This script command together with .rtcWaitForTestValue() can be used for such information sharing and for synchronization across probes.
Within a test run, one probe will call .rtcSetTestValue(). This will generate a key/value pair that will be stored in a shared memory across all probes in the test run. The other probes can then call .rtcWaitForTestValue() with the same key parameter to retrieve the value.
|key||string||The key to share across probes in the test run|
|value||string||The value to set for the key|
The code below makes all probes in the test run to wait until the first probe in the test gets to a certain point in the script. If the value isn’t received within 30 seconds, the other probes will fail the test.
- If you plan on running multiple sessions in parallel where each needs to synchronize separately (like multiple rooms running in parallel in a large stress test), then you should use .rtcSetSessionValue() instead
- This method is useful for:
- Synchronizing probes to start after a given point in time, such as having the students join a session after the teacher logs in, or dial a call after the other user becomes available
- Send information that is needed, such as the URL or session ID that is created ad hoc by one probe that is needed for the other probes in order to join the same session
- testRTC supports other synchronization mechanisms