Race condition between TargetIn event in StepRunner and events emission in TestStep
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- go
- 領域
- testing-qa
調査の方向性
pkg/runner/step_runner.go の 193 行目付近から始め、StepRunner が入力チャネルを介して targets を送信する方法、TestStep がイベントを発行する方法、outputLoop が結果を処理する方法を追跡します。EventTargetIn と TargetOut または TargetError の間で発生する順序の race condition を再現するか、その内容を推論し、その後、必要なイベント順序を維持する同期アプローチを定義し、既存のテストスイートで検証します。
索引モデルが issue の本文から書いたものです。
説明
The problem raises as we can't atomicly (at least without "ugly" locks in events emission) pass the target to the test step via channel and emit EventTargetIn event.
Currently we are having the following partial work-around:
https://github.com/linuxboot/contest/blob/main/pkg/runner/step_runner.go#L193
// put the target into step runner
case sr.input <- tgt:
// by the time we are hare, the test step could have already processed the target and emitted 100500 events
// test steps rarely emit events, so it is not a big issue. For consistency with TargetOut or TargetError I made this hack:
// we should always emit TargetIn before TargetOut or TargetError
// we have a race condition that outputLoop may receive result for this target first
// in that case we will emit TargetIn in outputLoop and should not emit it here
sr.mu.Lock()
if targetInfo.acquireTargetInEmission() {
if err := emitEvent(ctx, ev, target.EventTargetIn, tgt, nil); err != nil {
sr.setErrLocked(ctx, fmt.Errorf("failed to report target injection: %w", err))
}
}
sr.mu.Unlock()
- 主要言語
- Go
- スター
- 20
- フォーク
- 17
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
linuxboot/contest のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
update readme対応中かも @mimir-d が 1258 日前に担当しました。 オープンbug documentation
-
enhancement good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
-
enhancement good first issue v2_overhaul
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
enhancement good first issue
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
linuxboot/contest の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Gentleman-Programming/engram#1899 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
OpenTollGate/tollgate-module-basic-go#949 ·
メンテナーはふだん 1 日以内に返信