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

@ -324,6 +324,11 @@ object Source extends SourceApply {
*/
def single[T](element: T): Source[T, Unit] = apply(SynchronousIterablePublisher(List(element), "single")) // FIXME optimize
/**
* Create a `Source` that will continually emit the given element.
*/
def repeat[T](element: T): Source[T, Unit] = apply(() Iterator.continually(element)) // FIXME optimize
/**
* A `Source` with no elements, i.e. an empty stream that is completed immediately for every connected `Sink`.
*/