Interrupt tests rely on wall-clock sleeps

オープン 初心者向け
#260 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
cli, testing

調査の方向性

main_e2e_test.go の821〜838行目(割り込みの1秒前)と main_signal_unix_test.go の27行目(SIGTERMの200ミリ秒前)にある壁時計ベースのスリープから始めてください。既存の signalReady シームがどのように使われているか、またスキャンが待機可能な結果行を出力できるかを確認します。どちらのテストも割り込みを発生させるタイミングを決めるために time.Sleep を使っておらず、go test -run 'Interrupt|Signal' -count=20 . が繰り返し成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

good first issue severity: low testing

Summary

Two CLI tests time their interrupt with a fixed sleep. They expect it to land in the middle of a scan, which a slow runner can miss.

Where

  • main_e2e_test.go:821-838: sleeps 1 s, then interrupts a scan expected to take about 2 s
  • main_signal_unix_test.go:27: sleeps 200 ms before SIGTERM

Impact

On a slow or loaded runner the scan finishes before the interrupt arrives, and got >= len(want) fails. This is the same class as the recent flake fixes.

Suggested fix

Trigger the interrupt from an event (for example after the Nth result line on stdout, or through the existing signalReady seam) instead of a wall-clock sleep.

Acceptance criteria

  • No time.Sleep decides when the interrupt fires in either test.

Getting started

  • Relevant files: main_e2e_test.go, main_signal_unix_test.go
  • How to run tests: go test -run 'Interrupt|Signal' -count=20 .
  • Related docs: docs/DEVELOPER_GUIDE.md

Filed by repo-audit/full-audit at 3f671b2. Severity: low. Effort: S. audit-key: testing|main_e2e_test.go|interrupt-sleep

主要言語
Go
スター
1
フォーク
1
平均マージ
7時間 48分
マージ済み PR(30日)
6

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TMHSDigital/subenum のほかの issue

TMHSDigital/subenum の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。