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

chore(ci): wait more for a floating IP #153

Merged
merged 2 commits into from
Mar 16, 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
4 changes: 2 additions & 2 deletions src/common/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct KeyValue {
}

/// Deserialize a URL.
pub fn deser_optional_url<'de, D>(des: D) -> ::std::result::Result<Option<Url>, D::Error>
pub fn deser_optional_url<'de, D>(des: D) -> std::result::Result<Option<Url>, D::Error>
where
D: Deserializer<'de>,
{
Expand All @@ -45,7 +45,7 @@ where
}

/// Deserialize a key-value mapping.
pub fn deser_key_value<'de, D>(des: D) -> ::std::result::Result<HashMap<String, String>, D::Error>
pub fn deser_key_value<'de, D>(des: D) -> std::result::Result<HashMap<String, String>, D::Error>
where
D: Deserializer<'de>,
{
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
trivial_casts,
trivial_numeric_casts,
unconditional_recursion,
Expand All @@ -138,7 +137,8 @@
unused_doc_comments,
unused_import_braces,
unused_parens,
unused_qualifications,
// FIXME(dtantsur): https://github.com/rust-lang/rust/issues/122533
// unused_qualifications,
unused_results,
while_true
)]
Expand Down Expand Up @@ -664,7 +664,7 @@ pub use osauth::common::IdOrName;
pub use osauth::{EndpointFilters, Error, ErrorKind, InterfaceType, ValidInterfaces};

/// A result of an OpenStack operation.
pub type Result<T> = ::std::result::Result<T, Error>;
pub type Result<T> = std::result::Result<T, Error>;

pub use crate::cloud::Cloud;
pub use crate::common::Refresh;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub struct ValueCache<T: Clone>(RefCell<Option<T>>);
pub struct MapCache<K: Hash + Eq, V: Clone>(RefCell<HashMap<K, V>>);

impl fmt::Debug for Query {
fn fmt(&self, f: &mut fmt::Formatter) -> ::std::result::Result<(), fmt::Error> {
fn fmt(&self, f: &mut fmt::Formatter) -> std::result::Result<(), fmt::Error> {
write!(f, "{:?}", self.0)
}
}
Expand Down Expand Up @@ -83,7 +83,7 @@ impl Query {
}

impl Serialize for Query {
fn serialize<S>(&self, serializer: S) -> ::std::result::Result<S::Ok, S::Error>
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: Serializer,
{
Expand Down
23 changes: 17 additions & 6 deletions tests/integration-create-delete-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,23 @@ async fn test_server_ops_with_port() {
"A floating IP"
);

tokio::time::sleep(time::Duration::from_secs(1)).await;

server.refresh().await.expect("Cannot refresh the server");

let server_ip = server.floating_ip().expect("No floating IP");
assert_eq!(server_ip, floating_ip.floating_ip_address());
for attempt in 0..10 {
tokio::time::sleep(time::Duration::from_secs(1)).await;

server.refresh().await.expect("Cannot refresh the server");

match server.floating_ip() {
Some(server_ip) => {
assert_eq!(server_ip, floating_ip.floating_ip_address());
break;
}
None => {
if attempt == 9 {
panic!("Still no floating IP after 10 seconds");
}
}
}
}

floating_ip
.dissociate()
Expand Down
Loading