Skip to content

Commit

Permalink
Mark hook related test serial
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuaf committed Sep 6, 2021
1 parent 6705bca commit 5e07462
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hooks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,11 @@ pub fn run_hooks(hooks: Option<&Vec<Hook>>, container: Option<&Container>) -> Re
mod test {
use super::*;
use anyhow::{bail, Result};
use serial_test::serial;
use std::path::PathBuf;

#[test]
#[serial]
fn test_run_hook() -> Result<()> {
{
let default_container: Container = Default::default();
Expand Down Expand Up @@ -179,13 +181,14 @@ mod test {
}

#[test]
#[serial]
#[ignore]
// This will test executing hook with a timeout. Since the timeout is set in
// secs, minimally, the test will run for 1 second to trigger the timeout.
// Therefore, we leave this test in the normal execution.
fn test_run_hook_timeout() -> Result<()> {
let default_container: Container = Default::default();
// We use `/bin/cat` here to simulate a hook command that hangs.
// We use `tail -f /dev/null` here to simulate a hook command that hangs.
let hook = Hook {
path: PathBuf::from("tail"),
args: Some(vec![
Expand Down

0 comments on commit 5e07462

Please sign in to comment.