Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sidecar): flaky head tracker test #699

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading