Skip to content

Commit 471f15a

Browse files
committed
* Add test to reproduce continuation timeout.
1 parent a667d9a commit 471f15a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

projects/Test/Integration/TestToxiproxy.cs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,45 @@ public async Task TestPublisherConfirmationThrottling()
404404
Assert.Equal(TotalMessageCount, publishCount);
405405
}
406406

407+
[SkippableFact]
408+
[Trait("Category", "Toxiproxy")]
409+
public async Task TestRpcContinuationTimeout_GH1802()
410+
{
411+
Skip.IfNot(AreToxiproxyTestsEnabled, "RABBITMQ_TOXIPROXY_TESTS is not set, skipping test");
412+
413+
ConnectionFactory cf = CreateConnectionFactory();
414+
cf.Endpoint = new AmqpTcpEndpoint(IPAddress.Loopback.ToString(), _proxyPort);
415+
cf.ContinuationTimeout = TimeSpan.FromSeconds(1);
416+
cf.AutomaticRecoveryEnabled = false;
417+
cf.TopologyRecoveryEnabled = false;
418+
419+
await using IConnection conn = await cf.CreateConnectionAsync();
420+
await using IChannel ch = await conn.CreateChannelAsync();
421+
422+
string toxicName = $"rmq-localhost-bandwidth-{Now}-{GenerateShortUuid()}";
423+
var bandwidthToxic = new BandwidthToxic
424+
{
425+
Name = toxicName
426+
};
427+
bandwidthToxic.Attributes.Rate = 0;
428+
bandwidthToxic.Toxicity = 1.0;
429+
bandwidthToxic.Stream = ToxicDirection.DownStream;
430+
431+
Task<BandwidthToxic> addToxicTask = _toxiproxyManager.AddToxicAsync(bandwidthToxic);
432+
433+
await Task.Delay(TimeSpan.FromSeconds(1));
434+
435+
ch.ContinuationTimeout = TimeSpan.FromMilliseconds(5);
436+
QueueDeclareOk q = await ch.QueueDeclareAsync();
437+
}
438+
407439
private bool AreToxiproxyTestsEnabled
408440
{
409441
get
410442
{
443+
// TODO rabbitmq/rabbitmq-dotnet-client#1802
444+
return true;
445+
/*
411446
string s = Environment.GetEnvironmentVariable("RABBITMQ_TOXIPROXY_TESTS");
412447
413448
if (string.IsNullOrEmpty(s))
@@ -421,6 +456,7 @@ private bool AreToxiproxyTestsEnabled
421456
}
422457
423458
return false;
459+
*/
424460
}
425461
}
426462
}

0 commit comments

Comments
 (0)