Skip to content

Commit ce5cfd5

Browse files
authored
fix(ethexe-service): Fix flaky validators_election test (#5257)
1 parent 24b338b commit ce5cfd5

File tree

1 file changed

+11
-1
lines changed
  • ethexe/service/src/tests/utils

1 file changed

+11
-1
lines changed

ethexe/service/src/tests/utils/env.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,23 @@ impl TestEnv {
322322
};
323323

324324
let mut service = NetworkService::new(config, runtime_config).unwrap();
325+
let mut observer_events = observer_events.1.new_receiver();
325326

326327
let local_peer_id = service.local_peer_id();
327328

328329
let handle = task::spawn(
329330
async move {
330331
loop {
331-
let _event = service.select_next_some().await;
332+
tokio::select! {
333+
_event = service.select_next_some() => {}
334+
event = observer_events.select_next_some() => {
335+
if let ethexe_observer::ObserverEvent::BlockSynced(block_hash) = event {
336+
service
337+
.set_chain_head(block_hash)
338+
.expect("failed to update bootstrap network chain head");
339+
}
340+
}
341+
}
332342
}
333343
}
334344
.instrument(tracing::error_span!("network-stream")),

0 commit comments

Comments
 (0)