Skip to content

Commit

Permalink
Increase XCTest timeout for slow GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
joemasilotti committed Nov 9, 2023
1 parent 8db3da2 commit ff6d8e5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Tests/SessionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import Swifter
import WebKit
import XCTest

private let defaultTimeout: TimeInterval = 10
private let turboTimeout: TimeInterval = 30

class SessionTests: XCTestCase {
private static let server = HttpServer()

Expand Down Expand Up @@ -92,8 +95,7 @@ class SessionTests: XCTestCase {

@MainActor
func test_coldBootVisit_whenVisitFailsFromMissingLibrary_providesAnPageLoadError() async throws {
// 5 seconds more than Turbo.js timeout.
await visit("/missing-library", timeout: 35)
await visit("/missing-library", timeout: turboTimeout + defaultTimeout)

XCTAssertTrue(sessionDelegate.sessionDidFailRequestCalled)
XCTAssertTrue(sessionDelegate.sessionDidFinishRequestCalled)
Expand Down Expand Up @@ -124,7 +126,7 @@ class SessionTests: XCTestCase {
// MARK: - Server

@MainActor
private func visit(_ path: String, timeout: TimeInterval = 5) async {
private func visit(_ path: String, timeout: TimeInterval = defaultTimeout) async {
let expectation = self.expectation(description: "Wait for request to load.")
sessionDelegate.didChange = { expectation.fulfill() }

Expand Down

0 comments on commit ff6d8e5

Please sign in to comment.