Skip to content

EndToEnd tests deadlock when run at the command line with swift test #143

@euanh

Description

@euanh

The EndToEnd tests are commented out on macOS. Uncommenting them shows that they run from Xcode, but block forever when run from the command line with swift test.

The end to end tests try to run the generator by executing swift run swift-sdk-generator.

let generatorOutput = try await Shell.readStdout(
"cd \(packageDirectory) && swift run swift-sdk-generator \(runArguments)"
)

However the tests themselves are being run within within an existing Swift Package Manager instance which already has a lock on the .build directory, so the test run deadlocks.

We can verify this by redirecting the generator command output to a file:

      let generatorOutput = try await Shell.readStdout(
        "cd \(packageDirectory) && swift run swift-sdk-generator \(runArguments) > stdout 2> stderr"
      )

stderr shows that the swift run command executed by the test is blocked:

% cat Tests/stderr
Another instance of SwiftPM is already running using '/tmp/test/swift-sdk-generator/.build', waiting until that process has finished execution...

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtest suiteChanges to generator's test suite

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions