Skip to content

fix(conductor): don't panic during panic#1252

Merged
SuperFluffy merged 1 commit intomainfrom
superfluffy/dont-double-panic
Jul 9, 2024
Merged

fix(conductor): don't panic during panic#1252
SuperFluffy merged 1 commit intomainfrom
superfluffy/dont-double-panic

Conversation

@SuperFluffy
Copy link
Contributor

Summary

Avoid panicking if a test is already panicking.

Background

The Conductor test environment is checking if it shut down cleanly for every test. If not, it's panicking to signal that the test should fail.

However, if a test was already failing (panicking) due to another bad condition, this lead to the test being immediately aborted without printing any useful diagnostics.

This patch fixes this by only panicking if the test is not already panicking, and issuing a debug level message otherwise.

Changes

  • Change the Drop impl for the conductor test environment to only panic if the test is not already panicking.

Testing

This is to fix bad tests not providing useful information, which was encountered while writing another PR.

@SuperFluffy SuperFluffy requested a review from a team as a code owner July 9, 2024 09:45
@SuperFluffy SuperFluffy requested a review from Fraser999 July 9, 2024 09:45
@github-actions github-actions bot added the conductor pertaining to the astria-conductor crate label Jul 9, 2024
@SuperFluffy SuperFluffy added this pull request to the merge queue Jul 9, 2024
Merged via the queue into main with commit c7f209e Jul 9, 2024
@SuperFluffy SuperFluffy deleted the superfluffy/dont-double-panic branch July 9, 2024 13:55
steezeburger added a commit that referenced this pull request Jul 15, 2024
* main:
  feat(cli): add cmd to collect withdrawal events and submit as actions (#1261)
  fix(core, bridge, sequencer)!: dismabiguate return addresses (#1266)
  fix(withdrawer): support withdrawer address that differs from bridge address   (#1262)
  (core, sequencer)!: generate serde traits impls for all protocol protobufs (#1260)
  fix(charts): add resources for sequencer/cometbft (#1254)
  chore(sequencer)!: add metrics (#1248)
  fix(sequencer-utils): fixes issue in `parse_blob` tests (#1243)
  feat(core, proto)!: make bridge unlock memo string (#1244)
  fix(conductor): don't panic during panic (#1252)
  feat(core)!: lowerCamelCase for protobuf json mapping (#1250)
  refactor(bridge-withdrawer)!: refactor startup to a separate subtask and remove balance check from startup (#1190)
  fix: rollup archive node configurations (#1249)
  refactor(core, bridge-withdrawer)!: move bridge-unlock memo to core (#1245)
  fix(sequencer)!: store native asset ibc->trace mapping in init_chain (#1242)
steezeburger added a commit that referenced this pull request Jul 19, 2024
* main: (24 commits)
  chore: update `bytes` and `ics23` crates (#1279)
  fix(sequencer): improve and fix instrumentation (#1255)
  feature(charts): hermes chart fixes, bech32 updates, ibc bridge test (#1130)
  chore(cli): remove unused rollup cli code (#1275)
  chore(test): use a temporary file to not pollute the workspace (#1269)
  chore(sequencer): add mempool benchmarks (#1238)
  fix(bridge-withdrawer)!: fix nonce handling (#1215)
  feat(cli, bridge-withdrawer)!: share code between cli and service (#1270)
  feat(cli): add cmd to collect withdrawal events and submit as actions (#1261)
  fix(core, bridge, sequencer)!: dismabiguate return addresses (#1266)
  fix(withdrawer): support withdrawer address that differs from bridge address   (#1262)
  (core, sequencer)!: generate serde traits impls for all protocol protobufs (#1260)
  fix(charts): add resources for sequencer/cometbft (#1254)
  chore(sequencer)!: add metrics (#1248)
  fix(sequencer-utils): fixes issue in `parse_blob` tests (#1243)
  feat(core, proto)!: make bridge unlock memo string (#1244)
  fix(conductor): don't panic during panic (#1252)
  feat(core)!: lowerCamelCase for protobuf json mapping (#1250)
  refactor(bridge-withdrawer)!: refactor startup to a separate subtask and remove balance check from startup (#1190)
  fix: rollup archive node configurations (#1249)
  ...
bharath-123 pushed a commit that referenced this pull request Jul 25, 2024
## Summary
Avoid panicking if a test is already panicking.

## Background
The Conductor test environment is checking if it shut down cleanly for
every test. If not, it's panicking to signal that the test should fail.

However, if a test was already failing (panicking) due to another bad
condition, this lead to the test being immediately aborted without
printing any useful diagnostics.

This patch fixes this by only panicking if the test is not already
panicking, and issuing a debug level message otherwise.

## Changes
- Change the `Drop` impl for the conductor test environment to only
panic if the test is not already panicking.

## Testing
This is to fix bad tests not providing useful information, which was
encountered while writing another PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conductor pertaining to the astria-conductor crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants