Use Executor in AbstractWaitStrategy
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
調査の方向性
まず core/src/main/java/org/testcontainers/containers/wait/strategy/AbstractWaitStrategy.java を読み、特に EXECUTOR の宣言と waitUntilReady の統合を確認してください。この issue には Kotlin のコルーチンの例がありますが、名前付きテストや受け入れ基準はありません。変更を完了するには、executor を公開または置き換える方法について合意されたアプローチと、中断された wait strategy を検証するための定義された方法が必要です。
索引モデルが issue の本文から書いたものです。
説明
I am trying to bridge to a suspend version of waitUntilReady in AbstractWaitStrategy with something along the lines of:
suspend fun strategy(waitingStrategyTarget: WaitingStrategyTarget): Unit {
// run your strategy
}
class MyWaitStrategy : AbstractWaitStrategy() {
override fun waitUntilReady() {
val executor: ExecutorService = EXECUTOR // executor from AbstractWaitStrategy
runBlocking(executor.asCoroutineDispatcher()) {
strategy(waitingStrategyTarget)
}
}
}
or in a TestScope with JUnit this may look like:
@Test
fun testWithSuspendedWaitStrategy() =
runTest {
val strategy =
waitStrategy { target ->
// run my strategy
}
// MyContainer.waitUntil(strategy, ....)
}
fun TestScope.waitStrategy(
f: CoroutineScope.(target: WaitStrategyTarget) -> Unit
): AbstractWaitStrategy =
object : AbstractWaitStrategy() {
override fun waitUntilReady() {
launch(EXECUTOR.asCoroutineDispatcher()) {
f(this, waitStrategyTarget)
}
}
}
Is there a way how to implement this with EXECUTOR, being public instead of package private, or with another Executor, ExecutorService or something.
Any Feedback is welcome :D
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
testcontainers/testcontainers-java のほかの issue
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
testcontainers/testcontainers-java#11997 · コメント 1 件 ·
-
[Enhancement]: Document why singleton containers are required under Spring's test context caching オープンtype/enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
testcontainers/testcontainers-java#11967 ·
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
testcontainers/testcontainers-java#11941 ·
-
type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
testcontainers/testcontainers-java#11829 · コメント 1 件 ·
-
type/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
testcontainers/testcontainers-java#11578 ·
testcontainers/testcontainers-java の issue をすべて見る
似ている issue
-
Bug Java Platform: Java
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
getsentry/sentry-java#6138 · コメント 1 件 ·
-
bug needs triage p2
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · コメント 1 件 ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
apache/rocketmq-dashboard#4654 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100