Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 7575e79

Browse files
committed
Tweak the web request timeout for tests
1 parent aeb7dbb commit 7575e79

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/GitHub.Api/Application/ApplicationConfiguration.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ namespace GitHub.Unity
55
{
66
public static class ApplicationConfiguration
77
{
8+
public const int DefaultWebTimeout = 3000;
9+
810
static ApplicationConfiguration()
911
{
1012
var executingAssembly = typeof(ApplicationConfiguration).Assembly;
@@ -13,20 +15,15 @@ static ApplicationConfiguration()
1315
}
1416

1517
/// <summary>
16-
/// The currently executing assembly.
18+
/// The currently executing assembly.
1719
/// </summary>
18-
public static AssemblyName AssemblyName { get; private set; }
20+
public static AssemblyName AssemblyName { get; }
1921

2022
/// <summary>
21-
/// The product header used in the user agent.
23+
/// The product header used in the user agent.
2224
/// </summary>
2325
public static ProductHeaderValue ProductHeader { get; private set; }
2426

25-
private static int webTimeout = 3000;
26-
public static int WebTimeout
27-
{
28-
get { return webTimeout; }
29-
set { webTimeout = value; }
30-
}
27+
public static int WebTimeout { get; set; } = DefaultWebTimeout;
3128
}
32-
}
29+
}

src/tests/IntegrationTests/Download/DownloadTaskTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ public override void TestFixtureSetUp()
2424
base.TestFixtureSetUp();
2525
server = new TestWebServer.HttpServer();
2626
Task.Factory.StartNew(server.Start);
27+
ApplicationConfiguration.WebTimeout = 20000;
2728
}
2829

2930
public override void TestFixtureTearDown()
3031
{
3132
base.TestFixtureTearDown();
3233
server.Stop();
34+
ApplicationConfiguration.WebTimeout = ApplicationConfiguration.DefaultWebTimeout;
3335
}
3436

3537
[Test]

0 commit comments

Comments
 (0)