File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ static bool swift_task_isCurrentExecutorImpl(SerialExecutorRef executor) {
353
353
// / 0 - no logging
354
354
// / 1 - warn on each instance
355
355
// / 2 - fatal error
356
- static unsigned unexpectedExecutorLogLevel = 1 ;
356
+ static unsigned unexpectedExecutorLogLevel = 2 ;
357
357
358
358
static void checkUnexpectedExecutorLogLevel (void *context) {
359
359
#if SWIFT_STDLIB_HAS_ENVIRON
Original file line number Diff line number Diff line change 1
- // RUN: %target-run-simple-swift( -Xfrontend -disable-availability-checking -enable-actor-data-race-checks %import-libdispatch -parse-as-library) > %t.log 2>&1
2
- // RUN: %FileCheck %s < %t.log
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-build-swift %import-libdispatch -Xfrontend -disable-availability-checking -enable-actor-data-race-checks -parse-as-library -I %t %s -o %t/a.out -module-name main
3
+ // RUN: %target-codesign %t/a.out
4
+ // RUN: env %env-SWIFT_UNEXPECTED_EXECUTOR_LOG_LEVEL=1 %target-run %t/a.out 2>&1 | %FileCheck %s
5
+
6
+ // Make sure that without downgrade the program crashes by default
7
+ // RUN: not --crash %target-run %t/a.out 2>&1
3
8
4
9
// REQUIRES: executable_test
5
10
// REQUIRES: concurrency
@@ -59,14 +64,14 @@ actor MyActor {
59
64
struct Runner {
60
65
static func main( ) async {
61
66
print ( " Launching a main-actor task " )
62
- // CHECK: warning: data race detected: @MainActor function at main/data_race_detection.swift:23 was not called on the main thread
67
+ // CHECK: warning: data race detected: @MainActor function at main/data_race_detection.swift:28 was not called on the main thread
63
68
launchFromMainThread ( )
64
69
sleep ( 1 )
65
70
66
71
let actor = MyActor ( )
67
72
let actorFn = await actor . getTaskOnMyActor ( )
68
73
print ( " Launching an actor-instance task " )
69
- // CHECK: warning: data race detected: actor-isolated function at main/data_race_detection.swift:52 was not called on the same actor
74
+ // CHECK: warning: data race detected: actor-isolated function at main/data_race_detection.swift:57 was not called on the same actor
70
75
launchTask ( actorFn)
71
76
72
77
sleep ( 1 )
You can’t perform that action at this time.
0 commit comments