Relax live tests rerun the whole suite after a one-line body edit
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #262 di @kioku — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- compilers, testing-qa
Direzione di ricerca
Start in libs/relax/compiler/src/domain.rs at threads_besides and domain::enter, then compare how the live-test restart decision consumes that thread set. Build the issue's minimal-repro/ crate and run relax test ctfe-thread-repro --lib --live; edit src/lib.rs after the first pass to reproduce selected=all instead of the control's selected=affected. The live_test_results fixture came with c9f9d129e and lacks a proc macro, so extend or add a fixture covering constant-evaluation/macro-expansion worker registration. Done means the proc-macro case resets the static and reruns only affected, with the worker no longer counted as a test-started thread.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Verified on upstream Relax 27746f54 (Linux). minimal-repro/ is a standalone Rust library with two tests and one local identity proc macro; it has no registry dependencies. Neither test starts a thread.
Crate files
Cargo.toml
[package]
name = "ctfe-thread-repro"
version = "0.1.0"
edition = "2021"
[dependencies]
repro-macro = { path = "macros" }
src/lib.rs
use std::sync::atomic::{AtomicUsize, Ordering::Relaxed};
static COUNTER: AtomicUsize = AtomicUsize::new(0);
#[test]
fn affected() {
assert_eq!(COUNTER.swap(1, Relaxed), repro_macro::identity!(0));
}
#[test]
fn unrelated() {}
macros/Cargo.toml
[package]
name = "repro-macro"
version = "0.1.0"
edition = "2021"
[lib]
proc-macro = true
macros/src/lib.rs
extern crate proc_macro;
use proc_macro::TokenStream;
#[proc_macro]
pub fn identity(input: TokenStream) -> TokenStream {
input
}
Reproduce
- Create
minimal-repro/in a fresh working directory using the four files above. With the27746f54Relax build and a host Rust toolchain available, run from the crate root:
The recorded run used a freshrelax test ctfe-thread-repro --lib --liveHOMEandTMPDIR, with network access disabled. - Wait for both tests to pass and for
testverdict group=0. - In
src/lib.rs, changeCOUNTER.swap(1, Relaxed)toCOUNTER.swap(2, Relaxed)and save without stopping Relax. Do not change the expected old value (0).
Expected: Relax resets the affected test's static and reruns only affected (selected=affected, skipped=1).
Actual: Relax reports that it patched one function, then prints restarting (1 static(s) of the program hold an earlier run's values, and 1 thread(s) an earlier test started still run (thread-5)). It reruns both tests (selected=all, skipped=0).
testverdict group=0 ran=2 passed=2 failed=0 ms=191.5 selected=all skipped=0 why="unknown reach: 2 tests" borrowck=clean
relax live: restarting (1 static(s) of the program hold an earlier run's values, and 1 thread(s) an earlier test started still run (thread-5))
testverdict group=1 ran=2 passed=2 failed=0 ms=7.7 selected=all skipped=0 why="unknown reach: 2 tests" borrowck=clean
Control: In a fresh copy, replace repro_macro::identity!(0) with 0 and remove the repro-macro dependency from Cargo.toml. Repeat the edit: Relax resets the static and reruns only affected. No const-generic return is needed to reproduce the restart.
testverdict group=0 ran=2 passed=2 failed=0 ms=247.4 selected=all skipped=0 why="unknown reach: 2 tests" borrowck=clean
testverdict group=1 ran=1 passed=2 failed=0 ms=1.9 selected=affected skipped=1 statics_reset=1 borrowck=clean
Diagnosis: In the original larger case, a Relax worker registered during pre-test constant evaluation was counted as a thread started by an earlier test, forcing a restart instead of an affected-only rerun. The reduced case shows the same false attribution, but its black-box output does not identify the worker.
Origin: the restart rule came in with c9f9d129e ("relax test --live: each rerun starts from the program's initial statics"), which restarts "when a thread an earlier test started still runs". domain::threads_besides (libs/relax/compiler/src/domain.rs) counts every thread registered in the program's domain except the harness, and domain::enter registers any thread that runs program code, including Relax's own worker during constant evaluation and macro expansion. That registration predates c9f9d129e, and the commit's live_test_results fixture has no proc macro, so this case was likely not exercised.
Possibly related: #223 (proc-macro world in live sessions).
- Lingua principale
- Rust
- Stelle
- 601
- Fork
- 34
- Merge medio
- 1h 58m
- PR unite (30g)
- 45
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 makepad/relax
-
std: `SliceIndex<str>` missing for `std::ops` ranges, so generic `R: SliceIndex<str>` bounds failAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di makepad/relax
Issue simili
-
CI/CD ignore-for-release
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
eclipse-ankaios/ankaios#844 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
symposium-dev/symposium#530 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
topgrade-rs/topgrade#2540 ·
I maintainer di solito rispondono entro 1 giorno