Skip to content

Commit 7bb41c8

Browse files
committed
Mention the new Issue.Kind case, as well as why polling confirmations do not have a configurable clock
1 parent 4b98ff4 commit 7bb41c8

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

proposals/testing/NNNN-polling-confirmations.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,25 @@ confirmation doesn't pass:
217217
public struct PollingFailedError: Error, Sendable, CustomIssueRepresentable {}
218218
```
219219

220+
### New `Issue.Kind` case
221+
222+
A new issue kind will be added to report specifically when a test fails due to
223+
a failed polling confirmation.
224+
225+
```swift
226+
public struct Issue {
227+
public enum Kind {
228+
/// An issue due to a polling confirmation having failed.
229+
///
230+
/// This issue can occur when calling ``confirmation(_:until:within:pollingEvery:isolation:sourceLocation:_:)-455gr``
231+
/// or
232+
/// ``confirmation(_:until:within:pollingEvery:isolation:sourceLocation:_:)-5tnlk``
233+
/// whenever the polling fails, as described in ``PollingStopCondition``.
234+
case pollingConfirmationFailed
235+
}
236+
}
237+
```
238+
220239
### New Traits
221240

222241
Two new traits will be added to change the default values for the
@@ -460,6 +479,16 @@ to predict a good-enough polling iterations value. Most test authors will think
460479
in terms of a duration, and we would expect nearly all test authors to
461480
add helpers to compute a polling iteration for them.
462481

482+
### Take in a `Clock` instance
483+
484+
Polling confirmations could take in and use an custom Clock by test authors.
485+
This is not supported because Polling is often used to wait out other delays,
486+
which may or may not use the specified Clock. By staying with the default
487+
continuous clock, Polling confirmations will continue to work even if a test
488+
author otherwise uses a non-standard clock, such as one that skips all sleep
489+
calls, or a clock that allows test authors to specifically control how it
490+
advances.
491+
463492
### Use macros instead of functions
464493

465494
Instead of adding new bare functions, polling could be written as additional

0 commit comments

Comments
 (0)