Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
euanh opened this issue Nov 4, 2024 · 1 comment · Fixed by #144
Closed

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

euanh opened this issue Nov 4, 2024 · 1 comment · Fixed by #144
Assignees
Labels
bug Something isn't working test suite Changes to generator's test suite

Comments

@euanh
Copy link
Contributor

euanh commented Nov 4, 2024

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...
@euanh euanh added bug Something isn't working test suite Changes to generator's test suite labels Nov 4, 2024
@euanh euanh self-assigned this Nov 4, 2024
@euanh
Copy link
Contributor Author

euanh commented Nov 4, 2024

Setting a different scratch path helps avoid a conflict between the two Swift Package Manager instances:

  --scratch-path <scratch-path>    Specify a custom scratch directory path (default .build)

There may still some other problems to resolve, though.

@euanh euanh changed the title EndToEnd tests block forever when run at the command line with swift test EndToEnd tests deadlock when run at the command line with swift test Nov 5, 2024
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 5, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run by the macOS CI job.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 5, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run by the macOS CI job.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
enables the tests on macOS, so they can be run locally, but disables
them in CI by skipping them in Utilities/test.sh.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
enables the tests on macOS, so they can be run locally, but disables
them in CI by skipping them in Utilities/test.sh.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
enables the tests on macOS, so they can be run locally, but explictly
skips them in CI.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests cannot currently be run:

* they deadlock when run under `swift test` (swiftlang#143)
* the CI requires the use of an HTTP proxy to download from the
  Internet, but SDK generator does not support proxies (swiftlang#145)

The tests are conditionally compiled only on Linux, so we must skip
them in CI.
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests cannot currently be run:

* they deadlock when run under `swift test` (swiftlang#143)
* the CI requires the use of an HTTP proxy to download from the
  Internet, but SDK generator does not support proxies (swiftlang#145)

The tests are conditionally compiled only on Linux, so we must skip
them in CI.

Fixes swiftlang#45
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests cannot currently be run:

* they deadlock when run under `swift test` (swiftlang#143)
* the CI requires the use of an HTTP proxy to download from the
  Internet, but SDK generator does not support proxies (swiftlang#145)

The tests are conditionally compiled only on Linux, so we must skip
them in CI.

Fixes swiftlang#45
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests cannot currently be run:

* they deadlock when run under `swift test` (swiftlang#143)
* the CI requires the use of an HTTP proxy to download from the
  Internet, but SDK generator does not support proxies (swiftlang#145)

The tests are conditionally compiled only on Linux, so we must skip
them in CI.

Fixes swiftlang#45
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests cannot currently be run:

* they deadlock when run under `swift test` (swiftlang#143)
* the CI requires the use of an HTTP proxy to download from the
  Internet, but SDK generator does not support proxies (swiftlang#145)

The tests are not compiled on macOS, but this commit marks
them with `XCTSkip` so they are not run on Linux either.

Fixes swiftlang#45
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests cannot currently be run:

* they deadlock when run under `swift test` (swiftlang#143)
* the CI requires the use of an HTTP proxy to download from the
  Internet, but SDK generator does not support proxies (swiftlang#145)

The tests are not compiled on macOS, but this commit marks
them with `XCTSkip` so they are not run on Linux either.

Future commits will loosen these restrictions.

Fixes swiftlang#45
euanh added a commit that referenced this issue Nov 8, 2024
* QueryEngine: Calculate stable hashes for Foundation.URL and FoundationEssentials.URL

Until Swift 6.0, the fully-qualified name of the URL type was
`Foundation.URL`.  After the adoption of FoundationEssentials, the
name changed to `FoundationEssentials.URL`.  This difference causes
the hashes to change, so for backwards compatibility we pin the
type name to `Foundation.URL`.

Fixes #45

* tests: Run tests on Linux CI

The EndToEnd tests cannot currently be run:

* they deadlock when run under `swift test` (#143)
* the CI requires the use of an HTTP proxy to download from the
  Internet, but SDK generator does not support proxies (#145)

The tests are not compiled on macOS, but this commit marks
them with `XCTSkip` so they are not run on Linux either.

Future commits will loosen these restrictions.

Fixes #45
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
enables the tests on macOS, so they can be run locally, but explictly
skips them in CI.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS and Linux.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
allows the tests on macOS, so they can be run locally, but explictly
skips them in CI.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS and Linux.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
allows the tests on macOS, so they can be run locally, but explictly
skips them in CI.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS and Linux.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
allows the tests on macOS, so they can be run locally, but explictly
skips them in CI.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 8, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS and Linux.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
allows the tests on macOS, so they can be run locally, but explictly
skips them in CI.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 11, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS and Linux.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
allows the tests on macOS, so they can be run locally, but explictly
skips them in CI.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 11, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS and Linux.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
allows the tests on macOS, so they can be run locally, but explictly
skips them in CI.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 11, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS and Linux.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
allows the tests on macOS, so they can be run locally, but explictly
skips them in CI.

Fixes: swiftlang#143
euanh added a commit to euanh/swift-sdk-generator that referenced this issue Nov 11, 2024
The EndToEnd tests no longer deadlock under `swift test` and can
now be run on macOS and Linux.

The CI cannot currently run the end to end tests because SDK generator
cannot use the CI HTTP proxy to download packages.   This commit
explicitly skips the tests when running under CI.

The tests can be run under macOS and Linux for local testing.

Fixes: swiftlang#143
@euanh euanh closed this as completed in 9071f98 Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test suite Changes to generator's test suite
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant