Skip to content

Commit aa566b5

Browse files
authored
Make FunctionalTests.PluginTests.testCommandPluginCancellation more robust, skipping if it cannot proceed (#4123)
The FunctionalTests.PluginTests.testCommandPluginCancellation test counts on getting back a pid from the plugin, but it seems that this doesn't happen sometimes despite a three-second waiting period. This marks the test as skipped if this happens, logging more information about it. rdar://88792829 tracks investigation.
1 parent b318736 commit aa566b5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Tests/FunctionalTests/PluginTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,10 @@ class PluginTests: XCTestCase {
635635
let result = sync.wait(timeout: .now() + 3)
636636
XCTAssertEqual(result, .timedOut, "expected the plugin to time out")
637637

638-
// At this point we should have parsed out the process identifier.
639-
let pid = try XCTUnwrap(delegate.parsedProcessIdentifier, "expected to get a pid from the plugin")
638+
// At this point we should have parsed out the process identifier. But it's possible we don't always — this is being investigated in rdar://88792829.
639+
guard let pid = delegate.parsedProcessIdentifier else {
640+
throw XCTSkip("skipping test because no pid was received from the plugin; being investigated as rdar://88792829\n\(delegate.diagnostics.description)")
641+
}
640642

641643
// Check that it's running (we do this by asking for its priority — this only works on some platforms).
642644
#if os(macOS)

0 commit comments

Comments
 (0)