Skip to content

Commit

Permalink
test: loosen time constrains
Browse files Browse the repository at this point in the history
  • Loading branch information
azyobuzin committed Mar 22, 2021
1 parent 484ff29 commit 0ebfdcc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/BiDaFlow.Tests/Fluent/CompleteWhenTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ IPropagatorBlock<int, int> CreateDelayBlock(int delay, int multiplier)
}

var sourceBlock = new BufferBlock<int>();
var block1 = CreateDelayBlock(50, 1);
var block2 = CreateDelayBlock(75, 10);
var block1 = CreateDelayBlock(100, 1);
var block2 = CreateDelayBlock(150, 10);
var outputBlock = new BufferBlock<int>();

sourceBlock.LinkWithCompletion(block1);
Expand All @@ -44,7 +44,7 @@ IPropagatorBlock<int, int> CreateDelayBlock(int delay, int multiplier)
sourceBlock.Post(4); // to block2
sourceBlock.Complete();

var timeout = new TimeSpan(100 * TimeSpan.TicksPerMillisecond);
var timeout = new TimeSpan(500 * TimeSpan.TicksPerMillisecond);
(await outputBlock.ReceiveAsync(timeout)).Is(1);
(await outputBlock.ReceiveAsync(timeout)).Is(20);
(await outputBlock.ReceiveAsync(timeout)).Is(3);
Expand Down
12 changes: 6 additions & 6 deletions tests/BiDaFlow.Tests/Fluent/MergeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ IPropagatorBlock<int, int> CreateDelayBlock(int delay, int multiplier)
}

var sourceBlock = new BufferBlock<int>();
var block1 = CreateDelayBlock(50, 1);
var block2 = CreateDelayBlock(75, 10);
var block1 = CreateDelayBlock(100, 1);
var block2 = CreateDelayBlock(150, 10);

sourceBlock.LinkWithCompletion(block1);
sourceBlock.LinkWithCompletion(block2);
Expand All @@ -45,7 +45,7 @@ IPropagatorBlock<int, int> CreateDelayBlock(int delay, int multiplier)
sourceBlock.Post(4); // to block2
sourceBlock.Complete();

var timeout = new TimeSpan(100 * TimeSpan.TicksPerMillisecond);
var timeout = new TimeSpan(500 * TimeSpan.TicksPerMillisecond);
outputBlock.Receive(timeout).Is(1);
outputBlock.Receive(timeout).Is(20);
outputBlock.Receive(timeout).Is(3);
Expand Down Expand Up @@ -81,8 +81,8 @@ IPropagatorBlock<int, int> CreateDelayBlock(int delay, int multiplier)
}

var sourceBlock = new BufferBlock<int>();
var block1 = CreateDelayBlock(50, 1);
var block2 = CreateDelayBlock(75, 10);
var block1 = CreateDelayBlock(100, 1);
var block2 = CreateDelayBlock(150, 10);
var testBlock = FluentDataflow.Merge(new ISourceBlock<int>[] { block1, block2 });
var consumer = new TransformBlock<int, int>(
async x =>
Expand All @@ -105,7 +105,7 @@ IPropagatorBlock<int, int> CreateDelayBlock(int delay, int multiplier)
sourceBlock.Post(4); // to block2
sourceBlock.Complete();

var timeoutToken = TestUtils.CancelAfter(new TimeSpan(500 * TimeSpan.TicksPerMillisecond));
var timeoutToken = TestUtils.CancelAfter(new TimeSpan(2 * TimeSpan.TicksPerSecond));
(await consumer.AsAsyncEnumerable().ToArrayAsync(timeoutToken))
.Is(1, 20, 3, 40);
}
Expand Down

0 comments on commit 0ebfdcc

Please sign in to comment.