Skip to content

Commit

Permalink
fix: fix test for machines with 2 or less available processors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Zawadzki authored and gajewski-tomasz committed Nov 12, 2019
1 parent aec5c19 commit 48b4a8a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DisruptorAsyncPublisherSpec extends Specification {

private final int WORKER_COUNT = 2

private int PUBLISHER_SIZE = Runtime.getRuntime().availableProcessors() - WORKER_COUNT
private int PUBLISHER_SIZE = Math.max(2 * WORKER_COUNT, Runtime.getRuntime().availableProcessors() - WORKER_COUNT)

ExecutorService eventCreator = Executors.newFixedThreadPool(PUBLISHER_SIZE)
CountingPublisher sleepingPublisher = new CountingPublisher( { it-> sleep(10)})
Expand Down

0 comments on commit 48b4a8a

Please sign in to comment.