Skip to content

Commit bea28e4

Browse files
authored
Merge pull request #36285 from xymus/fix-flaky-lock-test
[Frontend/Test] Fix flaky lock_interface test
2 parents b6f0ff7 + daf9af4 commit bea28e4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/Driver/lock_interface.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010
// RUN: echo 'import Foo' > %t/file-01.swift
1111
// RUN: echo 'import Foo' > %t/file-02.swift
1212
// RUN: echo 'import Foo' > %t/file-03.swift
13-
// RUN: %target-swiftc_driver -j20 %t/main.swift %t/file-01.swift %t/file-02.swift %t/file-03.swift -I %t/sdk -Xfrontend -Rmodule-interface-rebuild -module-cache-path %t/module-cache &> %t/result.txt
14-
// RUN: %FileCheck %s -check-prefix=CHECK-REBUILD < %t/result.txt
13+
// RUN: %target-swiftc_driver -j20 %t/main.swift %t/file-01.swift %t/file-02.swift %t/file-03.swift -I %t/sdk -Xfrontend -Rmodule-interface-rebuild -module-cache-path %t/module-cache &> %t/result-with-lock.txt
1514

16-
// RUN: %target-swiftc_driver -j20 %t/main.swift %t/file-01.swift %t/file-02.swift %t/file-03.swift -I %t/sdk -Xfrontend -Rmodule-interface-rebuild -Xfrontend -disable-interface-lock -module-cache-path %t/module-cache-no-lock &> %t/result.txt
15+
/// Checking that the compiler rebuilds the same module more than once can
16+
/// fail depending on how fast the jobs are executed. Just make sure the
17+
/// compiler accepts the -disable-interface-lock flag.
18+
// RUN: %target-swiftc_driver -j20 %t/main.swift %t/file-01.swift %t/file-02.swift %t/file-03.swift -I %t/sdk -Xfrontend -Rmodule-interface-rebuild -Xfrontend -disable-interface-lock -module-cache-path %t/module-cache-no-lock &> %t/result-no-lock.txt
1719

18-
// RUN: %FileCheck %s -check-prefix=CHECK-REBUILD-NO-LOCK < %t/result.txt
19-
20-
// Reset the permissions
20+
/// Reset the permissions before running the tests likely to fail.
2121
// RUN: chmod a+w %t/sdk
2222

2323
// Ensure we only build Foo module once from the interface
24+
// RUN: %FileCheck %s -check-prefix=CHECK-REBUILD < %t/result-with-lock.txt
2425
// CHECK-REBUILD: rebuilding module 'Foo' from interface
2526
// CHECK-REBUILD-NOT: rebuilding module 'Foo' from interface
2627
// CHECK-REBUILD-NOT: building module interface without lock file
2728

28-
// CHECK-REBUILD-NO-LOCK: rebuilding module 'Foo' from interface
29-
// CHECK-REBUILD-NO-LOCK: rebuilding module 'Foo' from interface
29+
// RUN: %FileCheck %s -check-prefix=CHECK-REBUILD-NO-LOCK < %t/result-no-lock.txt
3030
// CHECK-REBUILD-NO-LOCK: rebuilding module 'Foo' from interface

0 commit comments

Comments
 (0)