just now it passed. I have changed nothing. it took 4 seconds.
This commit is contained in:
parent
c3fdf8fb9b
commit
634713171d
@ -19,7 +19,7 @@ namespace franz.tests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void reportsToSoundoff()
|
||||
public async Task reportsToSoundoff()
|
||||
{
|
||||
var f1Reported = false;
|
||||
var f2Reported = false;
|
||||
@ -42,6 +42,7 @@ namespace franz.tests
|
||||
});
|
||||
f1.StartListening();
|
||||
f2.StartListening();
|
||||
await Task.Delay(2000);
|
||||
f1.ProduceMessage(new silver_messages.global.sound_off());
|
||||
Task.WaitAny(
|
||||
Task.Run(async () => {
|
||||
@ -53,7 +54,7 @@ namespace franz.tests
|
||||
//TestContext.Out.WriteLine("done, ready, green");
|
||||
}),
|
||||
Task.Run(async () => {
|
||||
await Task.Delay(10000);
|
||||
await Task.Delay(120000);
|
||||
TestContext.Out.WriteLine("time up");
|
||||
Assert.Fail();
|
||||
})
|
||||
|
@ -122,13 +122,11 @@ namespace franz
|
||||
{
|
||||
StopListening();
|
||||
listenTask = Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
shouldListen = true;
|
||||
while (shouldListen)
|
||||
{
|
||||
var cr = consumer.Consume(125);
|
||||
var cr = consumer.Consume();
|
||||
if (cr != null)
|
||||
{
|
||||
var typeHaver = JsonConvert.DeserializeAnonymousType(cr.Message.Value, new { type = "" });
|
||||
@ -143,16 +141,6 @@ namespace franz
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.OperationCanceledException)
|
||||
{
|
||||
Console.WriteLine("cancelled");
|
||||
}
|
||||
catch (Confluent.Kafka.ConsumeException e)
|
||||
{
|
||||
Console.Error.WriteLine(JsonConvert.SerializeObject(e));
|
||||
throw;
|
||||
}
|
||||
});
|
||||
}
|
||||
public void StopListening()
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<PackageId>franz</PackageId>
|
||||
<PackageId>silvermeddlists.franz</PackageId>
|
||||
<Version>0.0.1</Version>
|
||||
<Authors>adam</Authors>
|
||||
<Company>Silver Meddlists</Company>
|
||||
|
Loading…
Reference in New Issue
Block a user