File tree Expand file tree Collapse file tree
tests/FSharp.Data.Core.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -207,12 +207,22 @@ let ``Timeout argument is used`` () =
207207
208208[<Test>]
209209let ``Setting timeout in customizeHttpRequest overrides timeout argument`` () =
210- use localServer = startHttpLocalServer()
211- let response =
212- Http.Request( localServer.BaseAddress + " /401?sleep=1000" , silentHttpErrors = true ,
213- customizeHttpRequest = ( fun req -> req.Timeout <- Threading.Timeout.Infinite; req), timeout = 1 )
214-
215- 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
216226
217227let testFormDataSizesInBytes = [
218228 4000 // previous test size
You can’t perform that action at this time.
0 commit comments