Skip to content
Merged
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: 10 additions & 0 deletions client/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ impl IdentityError {

#[cfg(test)]
mod test {
use std::time::Duration;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use std::time::Duration;
use std::time::{Duration, sleep};


use sush_common::codephrases::{PHRASE_WORDS_ID, WORD_SEPARATOR, generate_id};
use tempfile::TempDir;
use tokio::process::Command;
Expand Down Expand Up @@ -202,6 +204,14 @@ mod test {
.spawn()
.expect("failed to spawn ssh-agent");

// Wait for the agent to start up.
for _ in 0..20 {
if sock.exists() {
break;
}
tokio::time::sleep(Duration::from_millis(100)).await;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tokio::time::sleep(Duration::from_millis(100)).await;
sleep(Duration::from_millis(100)).await;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::time::sleep doesn't exist and isn't async 😅

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I meant tokio, sorry.

}

let status = Command::new("ssh-add")
.arg(&key)
.env("SSH_AUTH_SOCK", &sock)
Expand Down