Skip to content

Commit

Permalink
Merge pull request #699 from chainbound/jonas/fix/flaky-test
Browse files Browse the repository at this point in the history
fix(sidecar): flaky head tracker test
  • Loading branch information
mempirate authored Jan 17, 2025
2 parents 401b5c6 + 492630d commit 28d8b2e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions bolt-sidecar/src/common/backoff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ mod tests {
}

#[tokio::test]
#[ignore = "Flaky test, jitter can influence outcome"]
async fn test_exponential_backoff_timing() {
let counter = Arc::new(Mutex::new(Counter::new(3))); // Fail 3 times, succeed on 4th
let start_time = Instant::now();
Expand Down
5 changes: 4 additions & 1 deletion bolt-sidecar/src/state/head_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use beacon_api_client::Topic;
use futures::StreamExt;
use std::time::Duration;
use tokio::{sync::broadcast, task::AbortHandle, time::sleep};
use tracing::warn;
use tracing::{trace, warn};

use crate::client::BeaconClient;

Expand Down Expand Up @@ -42,6 +42,7 @@ impl HeadTracker {

let task = tokio::spawn(async move {
loop {
trace!(endpoint = %beacon_client.endpoint, "Subscribing to new head events...");
let mut event_stream = match beacon_client.get_events::<NewHeadsTopic>().await {
Ok(events) => events,
Err(err) => {
Expand All @@ -51,6 +52,8 @@ impl HeadTracker {
}
};

trace!(endpoint = %beacon_client.endpoint, "Subscribed to new head events");

let event = match event_stream.next().await {
Some(Ok(event)) => event,
Some(Err(err)) => {
Expand Down
2 changes: 1 addition & 1 deletion bolt-sidecar/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::{
const EXECUTION_API_URL: &str = "https://geth-holesky.bolt.chainbound.io";

/// The URL of the test beacon client HTTP API.
const BEACON_API_URL: &str = "https://lighthouse-holesky.bolt.chainbound.io";
const BEACON_API_URL: &str = "http://remotebeast:44400";

/// The URL of the test engine client HTTP API.
///
Expand Down

0 comments on commit 28d8b2e

Please sign in to comment.