> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# stopTestPeerToPeerCallQuality()

> Stops an in-progress testPeerToPeerCallQuality() test early.

`stopTestPeerToPeerCallQuality()`

<Badge color="red">{"✗"} Prebuilt</Badge> <Badge color="green">{"✓"} Custom</Badge>

Interrupts an in-progress [`testPeerToPeerCallQuality()`](/reference/daily-js/instance-methods/test-peer-to-peer-call-quality) test. The original Promise resolves immediately with whatever data has been collected so far. Also emits [`test-completed`](/reference/daily-js/events/network-events#test-completed).

If called before data gathering has started, the result is `'aborted'` with an empty `data` object. If data has been gathered, the result reflects the collected stats up to that point.

## Return value

Returns `void`.

## Example

```javascript theme={null}
await call.startCamera();
const videoTrack = call.participants().local.tracks.video.persistentTrack;

const testResultsPromise = call.testPeerToPeerCallQuality({
  videoTrack,
  duration: 250000,
});

// Stop early before joining
call.stopTestPeerToPeerCallQuality();
const results = await testResultsPromise;

if (results.result === 'bad') {
  console.warn('Poor network detected before joining.');
}
await call.join({ url: 'https://your-domain.daily.co/room' });
```

## See also

<CardGroup>
  <Card title="Methods" icon="code" iconType="solid">
    * [testPeerToPeerCallQuality()](/reference/daily-js/instance-methods/test-peer-to-peer-call-quality)
    * [testCallQuality()](/reference/daily-js/instance-methods/test-call-quality)
  </Card>

  <Card title="Events" icon="bolt" iconType="solid">
    * [test-completed](/reference/daily-js/events/network-events#test-completed)
  </Card>
</CardGroup>
