Skip to content

Commit 2089837

Browse files
authored
Merge pull request #12 from flox/fix/sleep-between-flushes
fix: move midline-flush.c sleep to occur between flush() invocations
2 parents ce29659 + 83caeb1 commit 2089837

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.flox/env/manifest.lock

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939
"build": {
4040
"t3": {
4141
"command": " make\n make test\n make install PREFIX=$out\n",
42-
"files": null,
43-
"runtime-packages": null,
44-
"systems": null,
4542
"sandbox": "pure"
4643
}
4744
}

tests/midline-flush.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ int main() {
1616
fflush(stdout);
1717
fflush(stderr);
1818
goodbye(stderr);
19-
usleep(30); // It only takes a millisecond to give stderr a head start
20-
// but we'll give it thirty to avoid false positives where
21-
// the first line is written to stdout.
2219
goodbye(stdout);
2320
fflush(stderr);
21+
usleep(10); // It only takes a millisecond to give stderr a head start
22+
// but we'll give it ten to avoid false positives where the
23+
// first line is written to stdout.
2424
fflush(stdout);
25+
usleep(10); // Sleep once more to ensure that stdout has a chance to
26+
// flush its buffer before the subsequent test runs.
2527
return 0;
2628
}

0 commit comments

Comments
 (0)