Skip to content

Commit

Permalink
Remove timeout feature
Browse files Browse the repository at this point in the history
Signed-off-by: Heinz N. Gies <heinz@licenser.net>
  • Loading branch information
Licenser committed Jul 1, 2022
1 parent fece3d6 commit 109b73d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions serial_test/Cargo.toml
Expand Up @@ -26,18 +26,14 @@ itertools = "0.10"
tokio = { version = "^1.17", features = ["macros", "rt"] }

[features]
default = ["logging", "timeout"]
default = ["logging"]

## Switches on debug logging (and requires the `log` package)
logging = ["log"]

## The file_locks feature unlocks the `file_serial`/`file_parallel` macros
file_locks = ["fslock"]

## The `timeout` feature lets tests time out after a certain amount of time
## if not enabled tests will wait indefinitely to be started
timeout = []

docsrs = ["document-features"]

# docs.rs-specific configuration
Expand Down
4 changes: 1 addition & 3 deletions serial_test/src/code_lock.rs
Expand Up @@ -3,7 +3,6 @@ use lazy_static::lazy_static;
#[cfg(feature = "logging")]
use log::debug;
use parking_lot::RwLock;
#[cfg(feature = "timeout")]
use std::time::Instant;
use std::{
collections::HashMap,
Expand Down Expand Up @@ -62,7 +61,7 @@ impl Default for UniqueReentrantMutex {
pub(crate) fn check_new_key(name: &str, max_wait: Option<Duration>) {
let start = Instant::now();
loop {
#[cfg(all(feature = "logging", feature = "timeout"))]
#[cfg(all(feature = "logging"))]
{
let duration = start.elapsed();
debug!("Waiting for '{}' {:?}", name, duration);
Expand All @@ -89,7 +88,6 @@ pub(crate) fn check_new_key(name: &str, max_wait: Option<Duration>) {
// If the try_lock fails, then go around the loop again
// Odds are another test was also locking on the write and has now written the key

#[cfg(feature = "timeout")]
if let Some(max_wait) = max_wait {
let duration = start.elapsed();
if duration > max_wait {
Expand Down

0 comments on commit 109b73d

Please sign in to comment.