Skip to content

test: enable some Concurrency tests on Windows #38280

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 1 commit into from
Jul 8, 2021
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

// This test is flaky on VS2017 (unknown reasons)
// UNSUPPORTED: MSVC_VER=15.0

// This test is failing on windows. SR-14447.
//
// UNSUPPORTED: OS=windows-msvc

@available(SwiftStdlib 5.5, *)
@main struct Main {
static func main() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

// UNSUPPORTED: OS=windows-msvc

struct Boom: Error {}
struct IgnoredBoom: Error {}

Expand Down
11 changes: 10 additions & 1 deletion test/Concurrency/Runtime/cancellation_handler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
// rdar://76038845
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
// UNSUPPORTED: OS=windows-msvc

// for sleep
#if canImport(Darwin)
import Darwin
#elseif canImport(Glibc)
import Glibc
#elseif os(Windows)
import WinSDK
#endif

class Canary {
Expand All @@ -30,7 +31,11 @@ if #available(SwiftStdlib 5.5, *) {
}
}
task.cancel()
#if os(Windows)
Sleep(1 * 1000)
#else
sleep(1)
#endif
detach {
await Task.withCancellationHandler {
print("Task was cancelled!")
Expand All @@ -39,7 +44,11 @@ if #available(SwiftStdlib 5.5, *) {
print("Running the operation...")
}
}
#if os(Windows)
Sleep(10 * 1000)
#else
sleep(10)
#endif
} else {
// Fake prints to satisfy FileCheck.
print("Canary")
Expand Down
2 changes: 0 additions & 2 deletions test/Concurrency/Runtime/checked_continuation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime

// UNSUPPORTED: OS=windows-msvc

import _Concurrency
import StdlibUnittest

Expand Down
1 change: 0 additions & 1 deletion test/Concurrency/Runtime/custom_executors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// REQUIRES: concurrency
// REQUIRES: executable_test

// UNSUPPORTED: OS=windows-msvc
// UNSUPPORTED: back_deployment_runtime
// UNSUPPORTED: use_os_stdlib

Expand Down