Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Race condition between TargetIn event in StepRunner and events emission in TestStep

Aperta
#84 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
go
Ambito
testing-qa

Direzione di ricerca

Inizia da pkg/runner/step_runner.go intorno alla riga 193 e segui come StepRunner invia i targets attraverso il suo canale di input, come TestStep emette gli eventi e come outputLoop gestisce i risultati. Riproduci o analizza la race condition nell’ordine tra EventTargetIn e TargetOut o TargetError, quindi definisci un approccio di sincronizzazione che preservi l’ordine degli eventi richiesto e verificalo con la suite di test esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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()
Lingua principale
Go
Stelle
20
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linuxboot/contest

Tutte le issue di linuxboot/contest

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.