@@ -22,14 +22,14 @@ class TestURLSession : LoopbackServerTest {
22
22
( " test_finishTaskAndInvalidate " , test_finishTasksAndInvalidate) ,
23
23
( " test_taskError " , test_taskError) ,
24
24
( " test_taskCopy " , test_taskCopy) ,
25
- // ("test_cancelTask", test_cancelTask), // Breaks on Ubuntu18.04, doesnt always cancel
25
+ ( " test_cancelTask " , test_cancelTask) ,
26
26
( " test_taskTimeout " , test_taskTimeout) ,
27
27
( " test_verifyRequestHeaders " , test_verifyRequestHeaders) ,
28
28
( " test_verifyHttpAdditionalHeaders " , test_verifyHttpAdditionalHeaders) ,
29
29
( " test_timeoutInterval " , test_timeoutInterval) ,
30
30
( " test_httpRedirectionWithCompleteRelativePath " , test_httpRedirectionWithCompleteRelativePath) ,
31
- ( " test_httpRedirectionWithInCompleteRelativePath " , test_httpRedirectionWithInCompleteRelativePath) , /* temporarily disabled. Needs HTTPServer rework */
32
- ( " test_httpRedirectionTimeout " , test_httpRedirectionTimeout) , /* temporarily disabled (https://bugs.swift.org/browse/SR-5751) */
31
+ ( " test_httpRedirectionWithInCompleteRelativePath " , test_httpRedirectionWithInCompleteRelativePath) ,
32
+ ( " test_httpRedirectionTimeout " , test_httpRedirectionTimeout) ,
33
33
( " test_http0_9SimpleResponses " , test_http0_9SimpleResponses) ,
34
34
( " test_outOfRangeButCorrectlyFormattedHTTPCode " , test_outOfRangeButCorrectlyFormattedHTTPCode) ,
35
35
( " test_missingContentLengthButStillABody " , test_missingContentLengthButStillABody) ,
@@ -231,10 +231,11 @@ class TestURLSession : LoopbackServerTest {
231
231
XCTFail ( " Intermittent failures on Android " )
232
232
#else
233
233
let urlString = " http://127.0.0.1: \( TestURLSession . serverPort) /Peru "
234
- let url = URL ( string: urlString) !
234
+ var urlRequest = URLRequest ( url: URL ( string: urlString) !)
235
+ urlRequest. setValue ( " 2.0 " , forHTTPHeaderField: " X-Pause " )
235
236
let d = DataTask ( with: expectation ( description: " GET \( urlString) : task cancelation " ) )
236
237
d. cancelExpectation = expectation ( description: " GET \( urlString) : task canceled " )
237
- d. run ( with: url )
238
+ d. run ( with: urlRequest )
238
239
d. cancel ( )
239
240
waitForExpectations ( timeout: 12 )
240
241
#endif
0 commit comments