From 8024989844dccae3eca4b7f73268c734d94b344f Mon Sep 17 00:00:00 2001 From: Agent Smith Date: Fri, 17 May 2024 17:04:00 +0800 Subject: [PATCH] ci: try fix ci hang --- .github/workflows/test.yml | 2 +- codecov.yml | 2 +- src/ast/test.rs | 14 ++++++++------ src/repl/test.rs | 2 +- vm/src/lib.rs | 3 +++ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ff3f36807..a8a30062e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -133,7 +133,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: llvm-cov - args: nextest --workspace --all-features --lcov --output-path lcov.info --profile ci -vv --no-capture + args: nextest --workspace --all-features --lcov --output-path lcov.info --profile ci -vv - name: Upload coverage to Codecov uses: codecov/codecov-action@v4.0.1 diff --git a/codecov.yml b/codecov.yml index 8b68f67c3..5276c61a7 100644 --- a/codecov.yml +++ b/codecov.yml @@ -18,4 +18,4 @@ ignore: - "src/lsp/wasm.rs" - "src/lsp/wasm.rs" - "src/repl/editor.rs" - - "src/repl/*.rs" + # - "src/repl/*.rs" diff --git a/src/ast/test.rs b/src/ast/test.rs index 676c4756b..174a61f02 100644 --- a/src/ast/test.rs +++ b/src/ast/test.rs @@ -2,6 +2,7 @@ use std::{ fs::remove_file, path::PathBuf, + process::Stdio, sync::{Arc, Mutex}, }; @@ -506,14 +507,15 @@ fn test_compile() { .unwrap_or_else(|_| panic!("static compiled file not found {:?}", exe)); eprintln!("exec: {:?}", exe); let o = Command::new(exe.to_str().unwrap()) - .output() + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .status() .expect("failed to execute compiled program"); + assert!( - o.status.success(), - "static compiled program failed with status {:?} and output {:?} and error {:?}", - o.status, - String::from_utf8_lossy(&o.stdout), - String::from_utf8_lossy(&o.stderr) + o.success(), + "static compiled program failed with status {:?}", + o, ); drop(l); } diff --git a/src/repl/test.rs b/src/repl/test.rs index ba049eb61..53dd11bb0 100644 --- a/src/repl/test.rs +++ b/src/repl/test.rs @@ -57,7 +57,7 @@ impl super::editor::TermEditor for TestEditor { } } -#[ignore] +// #[ignore] #[test] fn test_repl() { let rl = TestEditor::new( diff --git a/vm/src/lib.rs b/vm/src/lib.rs index 5ce45ddae..e4415ecc5 100644 --- a/vm/src/lib.rs +++ b/vm/src/lib.rs @@ -123,6 +123,9 @@ fn new_thread(f: *mut i128) { #[is_runtime] fn sleep(secs: u64) { + if secs > 100 { + panic!("sleep too long {}", secs); + } // gc::DioGC__stuck_begin(sp); println!("sleeping for {} secs", secs); thread::sleep(std::time::Duration::from_secs(secs));