Skip to content

Commit

Permalink
tests(pcli): 🔇 make large tracing event trace-level
Browse files Browse the repository at this point in the history
there are two issues at hand:
- we log `undelegation_result` twice
- `undelegation_result` can be many thousands of lines long

this means that the `delegate_and_undelegate` pcli network integration
test thrashes the test output somewhat severely, and test logs aren't
fully viewable in e.g. tmux, when running this locally.

https://github.com/penumbra-zone/penumbra/actions/runs/8210700115/job/22458602964#step:11:18

as of `main` at the time of writing, this CI job logs an event that
is...

```
; xclip -o -selection clipboard | wc --bytes
243775
```

243Kb is disruptively long. (_let alone 486Kb!_)

so, let's make this field an opt-in field to display. we only log it
once, and do so at the trace level.
  • Loading branch information
cratelyn committed Mar 10, 2024
1 parent a598c12 commit 0f087c4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/bin/pcli/tests/network_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,18 +323,14 @@ fn delegate_and_undelegate() {
.timeout(std::time::Duration::from_secs(TIMEOUT_COMMAND_SECONDS));
let undelegation_result = undelegate_cmd.assert().try_success();

tracing::debug!(?undelegation_result, "undelegation done - output");
tracing::debug!("undelegation done - output");
tracing::trace!(?undelegation_result);
// If the undelegation command succeeded, we can exit this loop.
if undelegation_result.is_ok() {
break;
} else {
num_attempts += 1;
tracing::info!(
?undelegation_result,
num_attempts,
max_attempts,
"undelegation failed"
);
tracing::info!(num_attempts, max_attempts, "undelegation failed");
if num_attempts >= max_attempts {
panic!("Exceeded max attempts for fallible command");
}
Expand Down

0 comments on commit 0f087c4

Please sign in to comment.