Skip to content

Commit 9d44abd

Browse files
committed
Try cleanup
1 parent 9cc231e commit 9d44abd

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

src/node.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ where
119119

120120
let kind = config.kind();
121121

122-
debug!("Spawning {kind} with config {config:?}",);
122+
debug!("Spawning {kind} with config {config:?}");
123123

124124
let stdout_path = config.log_path();
125125
let stdout_file = File::create(&stdout_path).context("Failed to create stdout file")?;
@@ -138,28 +138,27 @@ where
138138
.map(|(k, v)| (k, v.to_string()))
139139
.collect();
140140

141-
if let Ok(llvm_profile_file) = std::env::var("LLVM_PROFILE_FILE") {
142-
let dir = std::path::Path::new(&llvm_profile_file)
143-
.parent()
144-
.unwrap_or(std::path::Path::new("target/llvm-cov-target"));
141+
// if let Ok(llvm_profile_file) = std::env::var("LLVM_PROFILE_FILE") {
142+
// let dir = std::path::Path::new(&llvm_profile_file)
143+
// .parent()
144+
// .unwrap_or(std::path::Path::new("target/llvm-cov-target"));
145145

146-
let filename = format!("citrea-{}-%p-%m.profraw", kind);
146+
// let filename = format!("citrea-{}-%p-%m.profraw", kind);
147147

148-
let modified_profile = dir.join(filename).to_string_lossy().into_owned();
148+
// let modified_profile = dir.join(filename).to_string_lossy().into_owned();
149149

150-
println!(
151-
"Modified LLVM_PROFILE_FILE from {} to: {}",
152-
llvm_profile_file, modified_profile
153-
);
154-
env_vars.push(("LLVM_PROFILE_FILE", modified_profile));
155-
}
150+
// println!(
151+
// "Modified LLVM_PROFILE_FILE from {} to: {}",
152+
// llvm_profile_file, modified_profile
153+
// );
154+
// env_vars.push(("LLVM_PROFILE_FILE", modified_profile));
155+
// }
156156

157-
for var in &["RUSTFLAGS", "CARGO_LLVM_COV"] {
157+
for var in &["RUSTFLAGS", "CARGO_LLVM_COV", "LLVM_PROFILE_FILE"] {
158158
if let Ok(val) = std::env::var(var) {
159159
env_vars.push((var, val));
160160
}
161161
}
162-
println!("env_vars : {:?}", env_vars);
163162

164163
Command::new(&citrea)
165164
.args(get_citrea_args(config))

src/traits.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ pub trait NodeT: Send {
4242
signal::kill(Pid::from_raw(pid as i32), Signal::SIGTERM)
4343
.context("Failed to send SIGTERM signal to process")?;
4444

45-
// Try sleeping for now
46-
tokio::time::sleep(Duration::from_millis(5000)).await;
45+
// TODO Sleep until coverage file is written
46+
if std::env::var("CARGO_LLVM_COV").is_ok() {
47+
tokio::time::sleep(Duration::from_millis(5000)).await;
48+
}
4749
} else {
4850
info!("Process ID not found Killing process");
4951
process.kill().await.context("Failed to kill process")?;

0 commit comments

Comments
 (0)