Skip to content

Commit 84aa26b

Browse files
committed
wait for events to be written
1 parent a4c18f4 commit 84aa26b

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

crates/volta-core/src/monitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl Monitor {
2828
match json {
2929
Ok(data) => {
3030
// FIXME: tighten up this error message
31-
write!(p_stdin, "{}\n", data).expect("Writing data to plugin failed!");
31+
writeln!(p_stdin, "{}", data).expect("Writing data to plugin failed!");
3232
}
3333
Err(error) => {
3434
// FIXME: tighten up this error message

tests/acceptance/hooks.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::path::PathBuf;
2+
use std::{thread, time};
23

34
use crate::support::events_helpers::{assert_events, match_end, match_error, match_start};
45
use crate::support::sandbox::sandbox;
@@ -143,6 +144,7 @@ fn redirects_download() {
143144
.with_stderr_contains("[..]/hook/default/node/1.2.3")
144145
);
145146

147+
thread::sleep(time::Duration::from_millis(5000));
146148
assert_events(
147149
&s,
148150
vec![
@@ -172,6 +174,7 @@ fn merges_project_and_default_hooks() {
172174
.with_stderr_contains("[..]Could not download [email protected]")
173175
.with_stderr_contains("[..]/hook/project/yarn/3.2.1")
174176
);
177+
thread::sleep(time::Duration::from_millis(5000));
175178
assert_events(
176179
&s,
177180
vec![
@@ -190,6 +193,7 @@ fn merges_project_and_default_hooks() {
190193
.with_stderr_contains("[..]Could not download [email protected]")
191194
.with_stderr_contains("[..]/hook/default/node/10.12.1")
192195
);
196+
thread::sleep(time::Duration::from_millis(5000));
193197
assert_events(
194198
&s,
195199
vec![
@@ -226,6 +230,7 @@ fn merges_workspace_hooks() {
226230
.with_stderr_contains("[..]Could not download [email protected]")
227231
.with_stderr_contains("[..]/hook/project/yarn/3.1.4")
228232
);
233+
thread::sleep(time::Duration::from_millis(5000));
229234
assert_events(
230235
&s,
231236
vec![
@@ -244,6 +249,7 @@ fn merges_workspace_hooks() {
244249
.with_stderr_contains("[..]Could not download [email protected]")
245250
.with_stderr_contains("[..]/hook/workspace/npm/5.6.7")
246251
);
252+
thread::sleep(time::Duration::from_millis(5000));
247253
assert_events(
248254
&s,
249255
vec![

tests/acceptance/merged_platform.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::{thread, time};
2+
13
use crate::support::events_helpers::{assert_events, match_start, match_tool_end};
24
use crate::support::sandbox::{sandbox, DistroMetadata, NodeFixture, NpmFixture, YarnFixture};
35
use hamcrest2::assert_that;
@@ -257,6 +259,7 @@ fn uses_project_yarn_if_available() {
257259
.with_stderr_contains("[..]Yarn: 1.12.99 from project configuration")
258260
);
259261

262+
thread::sleep(time::Duration::from_millis(5000));
260263
assert_events(
261264
&s,
262265
vec![

0 commit comments

Comments
 (0)