Skip to content

Commit bb6efb5

Browse files
update
1 parent 0729e8f commit bb6efb5

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

Documentation/Proposals/NNNN-constrain-the-granularity-of-test-time-limit-durations.md Documentation/Proposals/0004-constrain-the-granularity-of-test-time-limit-durations.md

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
# Constrain the granularity of test time limit durations
22

33
* Proposal:
4-
[SWT-NNNN](NNNN-constrain-the-granularity-of-test-time-limit-durations.md)
4+
[SWT-0004](0004-constrain-the-granularity-of-test-time-limit-durations.md)
55
* Authors: [Dennis Weissmann](https://github.com/dennisweissmann)
6-
* Status: **Awaiting review**
6+
* Status: **Accepted**
77
* Implementation:
8-
[apple/swift-testing#NNNNN](https://github.com/apple/swift-testing/pull/NNNNN)
8+
[apple/swift-testing#534](https://github.com/apple/swift-testing/pull/534)
99
* Review:
10-
([pitch](https://forums.swift.org/t/pitch-constrain-the-granularity-of-test-time
11-
-limit-durations/73146))
10+
([pitch](https://forums.swift.org/t/pitch-constrain-the-granularity-of-test-time-limit-durations/73146))
1211

1312
## Introduction
1413

@@ -66,8 +65,10 @@ API.
6665

6766
## Detailed Design
6867

69-
The `TimeLimitTrait.Duration` struct only has one factory method: `public
70-
static func minutes(_ minutes: some BinaryInteger) -> Self`.
68+
The `TimeLimitTrait.Duration` struct only has one factory method:
69+
```swift
70+
public static func minutes(_ minutes: some BinaryInteger) -> Self`
71+
```
7172

7273
That ensures 2 things:
7374
1. It's impossible to create short time limits (under a minute).
@@ -114,7 +115,7 @@ public struct TimeLimitTrait: TestTrait, SuiteTrait {
114115
The extension on `Trait` that allows for `.timeLimit(...)` to work is defined
115116
like this:
116117

117-
```
118+
```swift
118119
/// Construct a time limit trait that causes a test to time out if it runs for
119120
/// too long.
120121
///
@@ -160,11 +161,11 @@ func serve100CustomersInOneHour() async {
160161
}
161162
```
162163

163-
The `TimeLimitTrait.Duration` struct has various `unavailable` overloads that
164-
are included for diagnostic purposes only. They are all documented and
164+
The `TimeLimitTrait.Duration` struct has various `unavailable` overloads that
165+
are included for diagnostic purposes only. They are all documented and
165166
annotated like this:
166167

167-
```
168+
```swift
168169
/// Construct a time limit duration given a number of <unit>.
169170
///
170171
/// This function is unavailable and is provided for diagnostic purposes only.
@@ -181,7 +182,8 @@ N/A
181182

182183
## Future Directions
183184

184-
N/A.
185+
We could allow more finegrained time limits but this was not considered.
186+
different tiime limits for different environments (CI vs desks).
185187

186188
## Alternatives Considered
187189

0 commit comments

Comments
 (0)