Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 2cd080c

Browse files
committed
#826 Disable connection pool for unit test
1 parent d195f34 commit 2cd080c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/Titanium.Web.Proxy.IntegrationTests/NestedProxyTests.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,25 @@ public async Task Nested_Proxy_Farm_Should_Not_Hang()
9393

9494
var proxies2 = new List<ProxyServer>();
9595

96-
//create a level 2 upstream proxy farm
96+
//create a level 2 upstream proxy farm that forwards to server
9797
for (int i = 0; i < 5; i++)
9898
{
99-
var proxy = testSuite.GetProxy();
100-
proxy.ProxyBasicAuthenticateFunc += (_, _, _) =>
99+
var proxy2 = testSuite.GetProxy();
100+
proxy2.ProxyBasicAuthenticateFunc += (_, _, _) =>
101101
{
102102
return Task.FromResult(true);
103103
};
104104

105-
proxies2.Add(proxy);
105+
proxies2.Add(proxy2);
106106
}
107107

108108
var proxies1 = new List<ProxyServer>();
109109

110-
//create a level 1 upstream proxy farm
111-
for (int i = 0; i < 5; i++)
110+
//create a level 1 upstream proxy farm that forwards to level 2 farm
111+
for (int i = 0; i < 10; i++)
112112
{
113113
var proxy1 = testSuite.GetProxy();
114+
proxy1.EnableConnectionPool = false;
114115
var proxy2 = proxies2[rnd.Next() % proxies2.Count];
115116

116117
var explicitEndpoint = proxy1.ProxyEndPoints.OfType<ExplicitProxyEndPoint>().First();
@@ -154,7 +155,7 @@ public async Task Nested_Proxy_Farm_Should_Not_Hang()
154155
{
155156
var proxy = proxies1[rnd.Next() % proxies1.Count];
156157
using var client = testSuite.GetClient(proxy);
157-
client.Timeout = TimeSpan.FromMinutes(10);
158+
client.Timeout = TimeSpan.FromSeconds(30);
158159
var response = await client.PostAsync(new Uri(server.ListeningHttpsUrl),
159160
new StringContent("hello server. I am a client."));
160161

0 commit comments

Comments
 (0)