fix two wrong/flaky tests

- ordering is not preserved by shufflers in GraphOpsIntegrationSpec
- larger tolerance is needed in GraphBalanceSpec since balancing does
  not keep track of previous imbalances
- also add Source.repeat(elem)
This commit is contained in:
Roland Kuhn 2015-02-26 12:36:46 +01:00
parent ac9c61a3a5
commit 743cd98bf4
7 changed files with 37 additions and 15 deletions

View file

@ -451,4 +451,12 @@ public class SourceTest extends StreamTest {
String result = Await.result(future2, probe.dilated(FiniteDuration.create(3, TimeUnit.SECONDS)));
assertEquals("A", result);
}
@Test
public void mustRepeat() throws Exception {
final Future<List<Integer>> f = Source.repeat(42).grouped(10000).runWith(Sink.<List<Integer>> head(), materializer);
final List<Integer> result = Await.result(f, FiniteDuration.create(3, TimeUnit.SECONDS));
assertEquals(result.size(), 10000);
for (Integer i: result) assertEquals(i, (Integer) 42);
}
}