Skip to content

[5.9] Disable taskgroup test on freestanding; they're not supported #66182

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions test/Concurrency/Runtime/async_taskgroup_dontLeakTasks.swift
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
// RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -parse-as-library) | %FileCheck %s
// TODO: move to target-run-simple-leaks-swift once CI is using at least Xcode 14.3

// This test uses `leaks` which is only available on apple platforms; limit it to macOS:
// REQUIRES: OS=macosx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we should remove this line? Does this test really run on Linux and Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is actually on purpose, but I did miss removing the import Darwin 😮‍💨 (that wasn't used, fixed now).

The reason for macos here is explained in the TODO above: // TODO: move to target-run-simple-leaks-swift once CI is using at least Xcode 14.3 so there's a new way to tests for leaks, but only Xcode 14.3 seems to be reliable enough in reporting them, so once we do that we can make this test use leaks and require macos

// Task group addTask is not supported in freestanding mode
// UNSUPPORTED: freestanding

// REQUIRES: executable_test
// REQUIRES: concurrency

// REQUIRES: concurrency_runtime
// UNSUPPORTED: back_deployment_runtime

import Darwin

final class Something {
let int: Int
init(int: Int) {
self.int = int
}

deinit {
print("deinit, Something, int: \(int)")
print("deinit, Something, int: \(self.int)")
}
}

func test_taskGroup_next() async {
let tasks = 5
_ = await withTaskGroup(of: Something.self, returning: Int.self) { group in
for n in 0..<tasks {
group.spawn {
group.addTask {
Something(int: n)
}
}
Expand Down