Skip to content

Commit

Permalink
Fixing appveyor tests
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Black <raskchanky@gmail.com>
  • Loading branch information
raskchanky committed Nov 13, 2018
1 parent e8b2766 commit 743f304
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions appveyor.yml
Expand Up @@ -26,6 +26,7 @@ environment:
CARGO_TARGET_DIR: "c:\\projects\\habitat\\target"
RUSTUP_USE_HYPER: 1
CARGO_HTTP_CHECK_REVOKE: false
RUST_BACKTRACE: 1
HAB_WINDOWS_STUDIO: true
BINTRAY_USER: chef-releng-ops
BINTRAY_KEY:
Expand Down
21 changes: 15 additions & 6 deletions components/sup/src/manager/user_config_watcher.rs
Expand Up @@ -329,17 +329,26 @@ mod tests {

fn wait_for_watcher<T: Serviceable>(ucm: &UserConfigWatcher, service: &T) -> bool {
let start = Instant::now();
let timeout = Duration::from_millis(1000);
let timeout = Duration::from_secs(10);

while start.elapsed() < timeout {
let state = ucm.states.get(service.name()).expect("service added");
match state.started_watching.try_recv() {
Ok(_) => return true,
Err(TryRecvError::Empty) => (),
Err(TryRecvError::Disconnected) => return false,
Ok(_) => {
println!("Received data on the start_watching channel. Returning true.");
return true;
}
Err(TryRecvError::Empty) => {
println!("Received nothing on the start_watching channel. Returning ().");
()
}
Err(TryRecvError::Disconnected) => {
println!("The start_watching channel was disconnected. Returning false.");
return false;
}
}

thread::sleep(Duration::from_millis(10));
thread::sleep(Duration::from_millis(100));
}

false
Expand All @@ -354,7 +363,7 @@ mod tests {
return true;
}

thread::sleep(Duration::from_millis(10));
thread::sleep(Duration::from_millis(100));
}

false
Expand Down
2 changes: 1 addition & 1 deletion support/ci/appveyor.bat
@@ -1 +1 @@
powershell -nologo -noprofile -executionpolicy bypass -file c:\projects\habitat\support\ci\appveyor.ps1
powershell -nologo -noprofile -executionpolicy bypass -file c:\projects\habitat\support\ci\appveyor.ps1
4 changes: 2 additions & 2 deletions support/ci/appveyor.ps1
Expand Up @@ -45,7 +45,7 @@ function Test-SourceChanged {
}

function Test-DocsOnlyChanged {
(Get-ChangedFiles |
(Get-ChangedFiles |
Where-Object {
!($_ -like '*.md') -and !($_ -like 'docs\*.md')
}
Expand Down Expand Up @@ -89,7 +89,7 @@ if(Test-DocsOnlyChanged -and !(Test-ReleaseBuild)) {
pushd "$(Get-RepoRoot)/components/$component"
Write-Host "Testing $component"
Write-Host ""
cargo test --verbose
cargo test --verbose -- --nocapture
if ($LASTEXITCODE -ne 0) {exit $LASTEXITCODE}
popd
}
Expand Down

0 comments on commit 743f304

Please sign in to comment.