Skip to content

Commit 15d4e6c

Browse files
committed
[Tests] Remove an unnecessary sleep().
1 parent c84c17a commit 15d4e6c

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

Tests/Functional/MiscellaneousTests.swift

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
See http://swift.org/CONTRIBUTORS.txt for Swift project authors
99
*/
1010

11+
import XCTest
12+
1113
import struct Utility.Path
1214
import func Utility.fopen
1315
import func Utility.fputs
14-
import func libc.sleep
1516
import enum POSIX.Error
1617
import func POSIX.popen
17-
import XCTest
1818

1919
class MiscellaneousTestCase: XCTestCase {
2020

@@ -276,10 +276,6 @@ class MiscellaneousTestCase: XCTestCase {
276276
var output = try popen(execpath)
277277
XCTAssertEqual(output, "Hello\n")
278278

279-
// we need to sleep at least one second otherwise
280-
// llbuild does not realize the file has changed
281-
sleep(1)
282-
283279
try fopen(prefix, "Bar/Bar.swift", mode: .write) { fp in
284280
try fputs("public let bar = \"Goodbye\"\n", fp)
285281
}
@@ -302,10 +298,6 @@ class MiscellaneousTestCase: XCTestCase {
302298
var output = try popen(execpath)
303299
XCTAssertEqual(output, "♣︎K\n♣︎Q\n♣︎J\n♣︎10\n♣︎9\n♣︎8\n♣︎7\n♣︎6\n♣︎5\n♣︎4\n")
304300

305-
// we need to sleep at least one second otherwise
306-
// llbuild does not realize the file has changed
307-
sleep(1)
308-
309301
try fopen(prefix, "app/Packages/FisherYates-1.2.3/src/Fisher-Yates_Shuffle.swift", mode: .write) { fp in
310302
try fputs("public extension Collection{ func shuffle() -> [Iterator.Element] {return []} }\n\npublic extension MutableCollection where Index == Int { mutating func shuffleInPlace() { for (i, _) in enumerated() { self[i] = self[0] } }}\n\npublic let shuffle = true", fp)
311303
}
@@ -328,10 +320,6 @@ class MiscellaneousTestCase: XCTestCase {
328320
var output = try popen(execpath)
329321
XCTAssertEqual(output, "Hello\n")
330322

331-
// we need to sleep at least one second otherwise
332-
// llbuild does not realize the file has changed
333-
sleep(1)
334-
335323
try fopen(prefix, "root/Packages/dep1-1.2.3/Foo.swift", mode: .write) { fp in
336324
try fputs("public let foo = \"Goodbye\"", fp)
337325
}

0 commit comments

Comments
 (0)