Long hang when starting testing in GitHub CI

In GitHub CI only, swift test on my little project has a long hang right after it completes its build commands (even if everything was already built—it does some trivial build steps) before any tests begin to run. Reproduces there on Mac and Windows, but not Linux, which is blazingly fast. I can’t reproduce it locally. Is anybody else seeing this?

Any chance you're using swiftly in CI but you're just trying to reproduce with Xcode toolchains locally?

Had a problem with swiftly toolchains a few weeks ago only on macOS (it’s not resolved, I just worked around it) so thought it's worth a shot to ask.

I’m using whatever SwiftyLab/setup-swift does. Happens on Mac and Windows, and swiftly doesn’t support Windows. is your problem with swiftly related to a hang in testing via SPM?

Nah its not a hang, but I thought it's worth a shot.

My issue (and a couple other people have also reported the same issue) is some kind of function lookup failure where swift chooses the default implementation of a requirement in a protocol, instead of resolving the function to the custom function the type conforming to that protocol is providing.

I can imagine this can somehow result in a hang too, under specific circumstances.

In my case it was a crash though.

My issue is unrelated. All the build steps are completed by the time the hang occurs. This is surely something in SPM.

Is this project open source? Can you share the log from the build job that was hanging?

Most of the details, including a very short excerpt of the log, are here. There's truly nothing interesting the build output (and --verbose doesn't change anything) but if you want everything it is here.

1 Like

Hmm… maybe some potential ideas:

  • I think this log implies you are testing debug? Have you seen the same hanging when testing release?
  • Are all those external dependencies necessary for your tests? Are any of those external dependencies only for targets other than the tests?
  • Do you know if the swift-syntax dependency is hitting the prebuilt cache? Or have you attempted to clone and build from scratch?
  • I've been using swiftly-action from Vapor in my repos. Do you have the option to experiment and switch actions?

I haven't tried release. All the dependencies are needed. It's hard to imagine that whether the swift-syntax dependency is in the cache is relevant, since all the build steps are complete by the time it hangs. Yes, I could switch actions, but anything based on swiftly won't work for Windows.

Could be `swift test` output is buffered (rather than streamed) for swift-testing tests on Windows · Issue #8928 · swiftlang/swift-package-manager · GitHub.

Nope, there are very few tests, they run fast even on windows, and, more importantly, it happens on macOS.