Skip to content

Commit

Permalink
test: remove env::set_var call in test logging initialization
Browse files Browse the repository at this point in the history
Per rust-lang/rust#90308, this is potentially a data race. In practice,
I don't think it was actually problematic here, but it also wasn't doing
anything of value, so we should remove it.

This is currently the only `env::set_var` or `env::remove_var` call in
the proxy.

Closes linkerd/linkerd2#7651
  • Loading branch information
hawkw committed Jan 20, 2022
1 parent d3cf6a0 commit c71626f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion linkerd/tracing/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ pub fn trace_subscriber(default: impl ToString) -> (Dispatch, Handle) {
.or_else(|_| env::var("RUST_LOG"))
.unwrap_or_else(|_| default.to_string());
let log_format = env::var("LINKERD2_PROXY_LOG_FORMAT").unwrap_or_else(|_| "PLAIN".to_string());
env::set_var("LINKERD2_PROXY_LOG_FORMAT", &log_format);
// This may fail, since the global log compat layer may have been
// initialized by another test.
let _ = init_log_compat();
Expand Down

0 comments on commit c71626f

Please sign in to comment.