Skip to content

Commit

Permalink
test: more robust wait in sender_allocation_relationship
Browse files Browse the repository at this point in the history
Signed-off-by: Alexis Asseman <[email protected]>
  • Loading branch information
aasseman committed Jan 19, 2024
1 parent 8787492 commit fff183d
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions tap-agent/src/tap/sender_allocation_relationship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,19 @@ mod tests {
}

// Wait for the RAV requester to finish.
tokio::time::sleep(std::time::Duration::from_millis(200)).await;
for _ in 0..100 {
if sender_allocation_relatioship
.inner
.unaggregated_fees
.lock()
.await
.value
< trigger_value
{
break;
}
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
}

// Get the latest RAV from the database.
let latest_rav = sqlx::query!(
Expand Down Expand Up @@ -975,7 +987,19 @@ mod tests {
}

// Wait for the RAV requester to finish.
tokio::time::sleep(std::time::Duration::from_millis(200)).await;
for _ in 0..100 {
if sender_allocation_relatioship
.inner
.unaggregated_fees
.lock()
.await
.value
< trigger_value
{
break;
}
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
}

// Get the latest RAV from the database.
let latest_rav = sqlx::query!(
Expand Down

0 comments on commit fff183d

Please sign in to comment.