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

test(tap-agent): remove false positives #248

Merged
merged 2 commits into from
Jul 9, 2024
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
10 changes: 5 additions & 5 deletions tap-agent/src/agent/sender_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ pub mod tests {
))
.unwrap();

tokio::time::sleep(Duration::from_millis(10)).await;
tokio::time::sleep(Duration::from_millis(20)).await;

assert_eq!(
triggered_rav_request.load(std::sync::atomic::Ordering::SeqCst),
Expand Down Expand Up @@ -1189,7 +1189,7 @@ pub mod tests {
},
))
.unwrap();
tokio::time::sleep(Duration::from_millis(30)).await;
tokio::time::sleep(Duration::from_millis(100)).await;

let retry_value = triggered_rav_request.load(std::sync::atomic::Ordering::SeqCst);
assert!(retry_value > 1, "It didn't retry more than once");
Expand Down Expand Up @@ -1236,7 +1236,7 @@ pub mod tests {
))
.unwrap();

tokio::time::sleep(Duration::from_millis(10)).await;
tokio::time::sleep(Duration::from_millis(20)).await;
};
}

Expand All @@ -1252,7 +1252,7 @@ pub mod tests {
))
.unwrap();

tokio::time::sleep(Duration::from_millis(10)).await;
tokio::time::sleep(Duration::from_millis(20)).await;
};
}

Expand Down Expand Up @@ -1519,7 +1519,7 @@ pub mod tests {
HashMap::from([(SENDER.1, vec![SIGNER.1])]),
));

tokio::time::sleep(Duration::from_millis(10)).await;
tokio::time::sleep(Duration::from_millis(20)).await;

let deny = call!(sender_account, SenderAccountMessage::GetDeny).unwrap();
assert!(deny, "should block the sender");
Expand Down
2 changes: 1 addition & 1 deletion tap-agent/src/agent/sender_accounts_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ mod tests {
))
.unwrap();

tokio::time::sleep(std::time::Duration::from_millis(10)).await;
tokio::time::sleep(std::time::Duration::from_millis(20)).await;
// verify if it gets removed
let actor_ref =
ActorRef::<SenderAccountMessage>::where_is(format!("{}:{}", prefix, SENDER.1));
Expand Down
6 changes: 4 additions & 2 deletions tap-agent/src/agent/sender_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ impl Actor for SenderAllocation {
SenderAllocationMessage::TriggerRAVRequest(reply) => {
if state.unaggregated_fees.value > 0 {
// auto backoff retry, on error ignore
let _ = state.request_rav().await;
if let Err(err) = state.request_rav().await {
error!(error = %err, "Error while requesting rav.");
}
}
if !reply.is_closed() {
let _ = reply.send((state.unaggregated_fees.clone(), state.latest_rav.clone()));
Expand Down Expand Up @@ -1124,7 +1126,7 @@ pub mod tests {
.await;

sender_allocation.stop_and_wait(None, None).await.unwrap();
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
tokio::time::sleep(std::time::Duration::from_millis(20)).await;

// check if the actor is actually stopped
assert_eq!(sender_allocation.get_status(), ActorStatus::Stopped);
Expand Down