This commit is contained in:
GH Action - Upstream Sync 2022-04-07 23:57:40 +00:00
Родитель 1c9b9eaf8f 6ac4185a42
Коммит e7f2384183
2 изменённых файлов: 25 добавлений и 4 удалений

Просмотреть файл

@ -262,12 +262,24 @@ namespace Test.Amqp
Assert.IsTrue(message != null);
receiver.Accept(message);
}
bool gotMessage = true;
for (int i = 0; i < 4; i++)
{
messages.Enqueue(new Message("test") { Properties = new Properties() { MessageId = name + count } });
var message = receiver.Receive(TimeSpan.FromMilliseconds(500));
Assert.IsTrue(message == null);
if (message == null)
{
gotMessage = false;
break;
}
receiver.Accept(message);
Thread.Sleep(1000);
}
Assert.IsTrue(!gotMessage, "Message should not be returned.");
receiver.Close();
session.Close();
connection.Close();

Просмотреть файл

@ -130,8 +130,12 @@ namespace Test.Amqp
Assert.AreEqual(ConnectionState.End, connection.ConnectionState);
try
{
Thread.Sleep(300);
networkStream.WriteByte(0);
for (int i = 0; i < 20; i++)
{
networkStream.WriteByte(0);
Thread.Sleep(100);
}
Assert.IsTrue(false, "transport connection not closed");
}
catch (IOException) { }
@ -156,7 +160,12 @@ namespace Test.Amqp
Assert.AreEqual((Symbol)ErrorCode.InvalidField, connection.Error.Condition);
try
{
networkStream.WriteByte(0);
for (int i = 0; i < 20; i++)
{
networkStream.WriteByte(0);
Thread.Sleep(100);
}
Assert.IsTrue(false, "transport connection not closed");
}
catch (IOException) { }