You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by he...@apache.org on 2025/01/08 02:50:53 UTC
(pekko) branch 1.1.x updated: chore: Test more rounds for unsafeDataVia keeping order. (#1680) (#1683)
This is an automated email from the ASF dual-hosted git repository.
hepin pushed a commit to branch 1.1.x
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/1.1.x by this push:
new 761003dc72 chore: Test more rounds for unsafeDataVia keeping order. (#1680) (#1683)
761003dc72 is described below
commit 761003dc7252eab9a4eed5cb3006d7a2a822301d
Author: He-Pin(kerr) <he...@gmail.com>
AuthorDate: Wed Jan 8 10:50:48 2025 +0800
chore: Test more rounds for unsafeDataVia keeping order. (#1680) (#1683)
(cherry picked from commit 2ee37454cb4a9058f4ad57b818f5d8cb783ba820)
---
.../stream/scaladsl/FlowWithContextSpec.scala | 24 ++++++++++++----------
.../stream/scaladsl/SourceWithContextSpec.scala | 18 ++++++++--------
2 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowWithContextSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowWithContextSpec.scala
index 9acee47c76..3fb0252dfe 100644
--- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowWithContextSpec.scala
+++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/FlowWithContextSpec.scala
@@ -194,17 +194,19 @@ class FlowWithContextSpec extends StreamSpec {
.asFlowWithContext[Option[String], Int, Int](collapseContext = Tuple2.apply)(extractContext = _._2)
.map(_._1)
- SourceWithContext
- .fromTuples(Source(data)).via(
- FlowWithContext.unsafeOptionalDataVia(
- flow,
- Flow.fromFunction { (string: String) => string.toInt }
- )(Keep.none)
- )
- .runWith(TestSink.probe[(Option[Int], Int)])
- .request(4)
- .expectNext((Some(1), 1), (None, 2), (None, 3), (Some(4), 4))
- .expectComplete()
+ for (_ <- 0 until 64) {
+ SourceWithContext
+ .fromTuples(Source(data)).via(
+ FlowWithContext.unsafeOptionalDataVia(
+ flow,
+ Flow.fromFunction { (string: String) => string.toInt }
+ )(Keep.none)
+ )
+ .runWith(TestSink.probe[(Option[Int], Int)])
+ .request(4)
+ .expectNext((Some(1), 1), (None, 2), (None, 3), (Some(4), 4))
+ .expectComplete()
+ }
}
}
}
diff --git a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceWithContextSpec.scala b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceWithContextSpec.scala
index 06650a7b77..3d05bd81ba 100644
--- a/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceWithContextSpec.scala
+++ b/stream-tests/src/test/scala/org/apache/pekko/stream/scaladsl/SourceWithContextSpec.scala
@@ -242,14 +242,16 @@ class SourceWithContextSpec extends StreamSpec {
val source = SourceWithContext.fromTuples(Source(data))
- SourceWithContext.unsafeOptionalDataVia(
- source,
- Flow.fromFunction { (string: String) => string.toInt }
- )(Keep.none)
- .runWith(TestSink.probe[(Option[Int], Int)])
- .request(4)
- .expectNext((Some(1), 1), (None, 2), (None, 3), (Some(4), 4))
- .expectComplete()
+ for (_ <- 0 until 64) {
+ SourceWithContext.unsafeOptionalDataVia(
+ source,
+ Flow.fromFunction { (string: String) => string.toInt }
+ )(Keep.none)
+ .runWith(TestSink.probe[(Option[Int], Int)])
+ .request(4)
+ .expectNext((Some(1), 1), (None, 2), (None, 3), (Some(4), 4))
+ .expectComplete()
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org