Skip to content

Commit 581520f

Browse files
KobzolSakib25800
authored andcommitted
Add timeout when waiting for the bors service to shut down
1 parent a3a1bf8 commit 581520f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/tests/mocks/bors.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,12 @@ impl BorsTester {
842842
self.merge_queue_tx.shutdown();
843843
self.mergeable_queue_tx.shutdown();
844844
// Wait until all events are handled in the bors service
845-
bors.await.unwrap();
845+
match tokio::time::timeout(Duration::from_secs(5), bors).await {
846+
Ok(res) => res.expect("Bors service ended with an error"),
847+
Err(_) => panic!(
848+
"Timed out waiting for bors service to shutdown. Maybe you forgot to close some channel senders?"
849+
),
850+
}
846851
// Flush any local queues
847852
self.http_mock.gh_server.assert_empty_queues().await;
848853
self.github

0 commit comments

Comments
 (0)