Skip to content

Commit

Permalink
Remove throttling.throttleLast.thread test
Browse files Browse the repository at this point in the history
  • Loading branch information
skoppe committed Aug 22, 2022
1 parent ab00c96 commit 9f13d3e
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions tests/ut/concurrency/stream.d
Original file line number Diff line number Diff line change
Expand Up @@ -384,42 +384,6 @@ import concurrency.thread : ThreadSender;
.syncWait.assumeOk.shouldThrowWithMessage("Bla");
}

@("throttling.throttleLast.thread")
@safe unittest {
import core.time;
import concurrency.scheduler : ManualTimeWorker;
import concurrency.operations : withScheduler, whenAll;
import concurrency.sender : justFrom;

shared int p = 0;
auto worker = new shared ManualTimeWorker();

auto throttled = 1.msecs
.intervalStream(true)
.via(ThreadSender())
.scan((int acc) => acc+1, 0)
.throttleLast(3.msecs)
.take(4)
.collect((int i) shared { p.atomicOp!"+="(i); })
.withScheduler(worker.getScheduler);

auto driver = justFrom(() shared @trusted {
worker.wait();
p.atomicLoad.should == 0;

foreach(expected; [0,0,3,3,3,9,9,9,18,18,18,30]) {
worker.advance(1.msecs);
p.atomicLoad.should == expected;
}

worker.timeUntilNextEvent().should == null;
});

whenAll(throttled, driver).syncWait().assumeOk;

p.atomicLoad.should == 30;
}

@("throttling.throttleLast.thread.arrayStream")
@safe unittest {
import core.time;
Expand Down

0 comments on commit 9f13d3e

Please sign in to comment.