Skip to content

Commit 6c4e43f

Browse files
committed
Added drop impl to clean up after tests
Changed revert tests a bit
1 parent fa3fd4b commit 6c4e43f

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

crates/op-rbuilder/src/tests/framework/harness.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl TestHarnessBuilder {
128128
let builder_log_path = builder.log_path.clone();
129129

130130
Ok(TestHarness {
131-
_framework: framework,
131+
framework: framework,
132132
builder_auth_rpc_port,
133133
builder_http_port,
134134
validator_auth_rpc_port,
@@ -138,7 +138,7 @@ impl TestHarnessBuilder {
138138
}
139139

140140
pub struct TestHarness {
141-
_framework: IntegrationFramework,
141+
framework: IntegrationFramework,
142142
builder_auth_rpc_port: u16,
143143
builder_http_port: u16,
144144
validator_auth_rpc_port: u16,
@@ -252,6 +252,16 @@ impl TestHarness {
252252
}
253253
}
254254

255+
impl Drop for TestHarness {
256+
fn drop(&mut self) {
257+
for service in &mut self.framework.services {
258+
let res = service.stop();
259+
if let Err(e) = res {
260+
println!("Failed to stop service: {}", e);
261+
}
262+
}
263+
}
264+
}
255265
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
256266
pub enum TransactionStatus {
257267
NotFound,

crates/op-rbuilder/src/tests/framework/op.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ impl Service for OpRbuilderConfig {
149149
if let Some(http_port) = self.http_port {
150150
cmd.arg("--http")
151151
.arg("--http.port")
152-
.arg(http_port.to_string())
153-
.arg("--http.api")
154-
.arg("eth,web3,txpool");
152+
.arg(http_port.to_string());
155153
}
156154

157155
if let Some(flashblocks_ws_url) = &self.flashblocks_ws_url {

crates/op-rbuilder/src/tests/vanilla/data_availability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async fn data_availability_block_size_limit() -> eyre::Result<()> {
6969
/// We should not forget about builder transaction so we will spawn only 2 regular txs.
7070
#[tokio::test]
7171
async fn data_availability_block_fill() -> eyre::Result<()> {
72-
let harness = TestHarnessBuilder::new("data_availability_tx_size_limit")
72+
let harness = TestHarnessBuilder::new("data_availability_block_fill")
7373
.with_namespaces("admin,eth,miner")
7474
.build()
7575
.await?;

crates/op-rbuilder/src/tests/vanilla/revert.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use crate::{
1313
async fn revert_protection_monitor_transaction_gc() -> eyre::Result<()> {
1414
let harness = TestHarnessBuilder::new("revert_protection_monitor_transaction_gc")
1515
.with_revert_protection()
16+
.with_namespaces("eth,web3,txpool")
1617
.build()
1718
.await?;
1819

@@ -105,6 +106,7 @@ async fn revert_protection_disabled_bundle_endpoint_error() -> eyre::Result<()>
105106
async fn revert_protection_bundle() -> eyre::Result<()> {
106107
let harness = TestHarnessBuilder::new("revert_protection_bundle")
107108
.with_revert_protection()
109+
.with_namespaces("eth,web3,txpool")
108110
.build()
109111
.await?;
110112

0 commit comments

Comments
 (0)