RPC unit test timeout fix (#28998)

This commit is contained in:
Brennan Watt 2022-12-02 08:47:09 -08:00 committed by GitHub
parent 0809a4df78
commit 9cb0151544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -1411,6 +1411,12 @@ pub(crate) mod tests {
encoding: UiAccountEncoding::Binary,
}));
// Sleep here to ensure adequate time for the async thread to fully process the
// subscribed notification before the bank transaction is processed. Without this
// sleep, the bank transaction ocassionally completes first and we hang forever
// waiting to receive a bank notification.
std::thread::sleep(Duration::from_millis(100));
bank_forks
.read()
.unwrap()