IntervalOpExecSpec uses an unseeded global Random, making failures unreproducible
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 86/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- scala
- Ambito
- testing-qa
Direzione di ricerca
Inizia con common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/intervalJoin/IntervalOpExecSpec.scala, in particolare con l’importazione e gli utilizzi di Random alle righe 243, 244, 486, 487 e 495. Esegui WorkflowOperator/jacoco due volte come descritto, escludendo FileScanSourceOpExec, e confronta i contatori dei branch di IntervalJoinOpExec.scala. Il lavoro è completato quando la spec mantiene input variati mentre le esecuzioni ripetute producono risultati riproducibili.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
IntervalOpExecSpec drives its inputs from the global, unseeded scala.util.Random, so its execution path — and therefore its branch coverage — differs from run to run.
import scala.util.Random.{nextInt, nextLong}
...
val leftOrder = LazyList.continually(nextInt(10)).take(leftInput.length).toList
val rightOrder = LazyList.continually(nextInt(10)).take(rightInput.length).toList
...
val pointList: Array[Long] = LazyList.continually(nextLong()).take(1000).toArray
val rangeList: Array[Long] = LazyList.continually(nextLong()).take(1000).toArray
scala.util.Random used this way is the shared singleton with no seed, so nothing is reproducible.
Two consequences.
The one that is merely annoying: WorkflowOperator's module-wide branch totals are not stable. Two WorkflowOperator/jacoco runs on the same tree, differing only in an unrelated spec, reported IntervalJoinOpExec.scala at 21 and then 22 missed branch arms. That was isolated by diffing every <sourcefile> between the two reports. Anyone quoting module-wide arm counts from a single run can be off by a few, through no fault of their change.
The one that matters more: a genuine failure here may not reproduce. If an ordering or a nextLong() value trips a real bug in the interval-join logic, the run that catches it cannot be replayed, and a re-run will very likely go green.
The fix is small — seed a local generator, e.g. val rng = new scala.util.Random(42) and use rng.nextInt / rng.nextLong — which keeps the input variety while making every run reproducible.
Note the spec filename is IntervalOpExecSpec.scala, not IntervalJoinOpExecSpec.scala, so a search keyed on the class name misses it.
How to reproduce?
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/intervalJoin/IntervalOpExecSpec.scala:31— theimport scala.util.Random.{nextInt, nextLong}, then uses at lines 243, 244, 486, 487 and 495.- Run
WorkflowOperator/jacocotwice on an unchanged tree, one fresh sbt JVM each, removingcommon/workflow-operator/target/scala-2.13/jacocobetween runs. Compare the<counter type="BRANCH">figures forIntervalJoinOpExec.scalain the twojacoco.xmlreports; they differ between runs.
Exclude FileScanSourceOpExecSpec when doing this — it aborts at suite level on Windows in its own cleanup, and because sbt-jacoco runs unforked and skips saveRuntimeData when the test task fails, an unfiltered run emits an all-zero report rather than a partial one.
Version/Branch
1.3.0-incubating-SNAPSHOT (main)
Was this issue authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)
- Lingua principale
- Scala
- Stelle
- 316
- Fork
- 189
- Merge medio
- 2g 20h
- PR unite (30g)
- 198
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/texera
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
release/v1.2 Required Checks fails at startup: sbt/setup-sbt pin not on ASF actions allowlist Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Tutte le issue di apache/texera
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ergoplatform/ergodocs#614 ·
-
area:ci enhancement requires-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
apache/datafusion-comet#6078 ·
-
[VL] madvise(WILLNEED) call fails in MmapFileStream because of wrong calculation of fetching length Apertabug triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
chipsalliance/rocket-chip#3831 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100