@@ -206,14 +206,23 @@ let ``Timeout argument is used`` () =
206206 exc.Status |> should equal WebExceptionStatus.Timeout
207207
208208[<Test>]
209- [<Conditional( " NOT_WINDOWS_CI" ) >]
210209let ``Setting timeout in customizeHttpRequest overrides timeout argument`` () =
211- use localServer = startHttpLocalServer()
212- let response =
213- Http.Request( localServer.BaseAddress + " /401?sleep=1000" , silentHttpErrors = true ,
214- customizeHttpRequest = ( fun req -> req.Timeout <- Threading.Timeout.Infinite; req), timeout = 1 )
215-
216- response.StatusCode |> should equal 401
210+ // Skip this test on Windows when running in CI because of flaky timeout behavior on some Windows CI agents.
211+ let isWindows = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform( System.Runtime.InteropServices.OSPlatform.Windows)
212+ let inCi =
213+ let env v = Environment.GetEnvironmentVariable v
214+ [ " CI" ; " GITHUB_ACTIONS" ; " TF_BUILD" ; " APPVEYOR" ; " GITLAB_CI" ; " JENKINS_URL" ]
215+ |> List.exists ( fun e -> not ( String.IsNullOrEmpty ( env e)))
216+
217+ if isWindows && inCi then
218+ Assert.Ignore( " Skipping test on Windows in CI" )
219+ else
220+ use localServer = startHttpLocalServer()
221+ let response =
222+ Http.Request( localServer.BaseAddress + " /401?sleep=1000" , silentHttpErrors = true ,
223+ customizeHttpRequest = ( fun req -> req.Timeout <- Threading.Timeout.Infinite; req), timeout = 1 )
224+
225+ response.StatusCode |> should equal 401
217226
218227let testFormDataSizesInBytes = [
219228 4000 // previous test size
0 commit comments