Skip to content

Commit

Permalink
Slightly increase the default timeout for precondition assertions (#17)
Browse files Browse the repository at this point in the history
# Slightly increase the default timeout for precondition assertions

## ♻️ Current situation & Problem
This PR increases the default timeout from 0.01s to 1s. In the last few
days, tests were sometimes failing as XCTRuntimePrecondition failed to
result in a precondition in the specified timeout. Therefore, we
increase the default timeout to a less restrictive value.

## ⚙️ Release Notes 
* Increase default timeout from 0.01s  to 1s for XCTRuntimePrecondition.


## 📚 Documentation
--


## ✅ Testing
--

### Code of Conduct & Contributing Guidelines 

By submitting creating this pull request, you agree to follow our [Code
of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md):
- [x] I agree to follow the [Code of
Conduct](https://github.com/StanfordBDHG/.github/blob/main/CODE_OF_CONDUCT.md)
and [Contributing
Guidelines](https://github.com/StanfordBDHG/.github/blob/main/CONTRIBUTING.md).
  • Loading branch information
Supereg authored Aug 15, 2024
1 parent a2b1275 commit f560ec8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/XCTRuntimeAssertions/XCTRuntimePrecondition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Foundation
/// - Throws: Throws an `XCTFail` error if the expression does not trigger a runtime assertion with the parameters defined above.
public func XCTRuntimePrecondition(
validateRuntimeAssertion: ((String) -> Void)? = nil,
timeout: TimeInterval = 0.01,
timeout: TimeInterval = 1,
_ message: @autoclosure () -> String = "",
file: StaticString = #filePath,
line: UInt = #line,
Expand Down Expand Up @@ -80,7 +80,7 @@ public func XCTRuntimePrecondition(
/// - Throws: Throws an `XCTFail` error if the expression does not trigger a runtime assertion with the parameters defined above.
public func XCTRuntimePrecondition(
validateRuntimeAssertion: ((String) -> Void)? = nil,
timeout: TimeInterval = 0.01,
timeout: TimeInterval = 1,
_ message: @autoclosure () -> String = "",
file: StaticString = #filePath,
line: UInt = #line,
Expand Down

0 comments on commit f560ec8

Please sign in to comment.