Changeset View
Changeset View
Standalone View
Standalone View
src/filesystem/__tests__/PhutilDeferredLogTestCase.php
| Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | public function testManyWriters() { | ||||
| $n_writers = 3; | $n_writers = 3; | ||||
| $n_lines = 8; | $n_lines = 8; | ||||
| $tmp = new TempFile(); | $tmp = new TempFile(); | ||||
| $futures = array(); | $futures = array(); | ||||
| for ($ii = 0; $ii < $n_writers; $ii++) { | for ($ii = 0; $ii < $n_writers; $ii++) { | ||||
| $futures[] = new ExecFuture('%s %d %s', $bin, $n_lines, (string)$tmp); | $futures[] = new ExecFuture('php %s %d %s', $bin, $n_lines, (string)$tmp); | ||||
| } | } | ||||
| id(new FutureIterator($futures)) | id(new FutureIterator($futures)) | ||||
| ->resolveAll(); | ->resolveAll(); | ||||
| $this->assertEqual( | $this->assertEqual( | ||||
| str_repeat("abcdefghijklmnopqrstuvwxyz\n", $n_writers * $n_lines), | str_repeat("abcdefghijklmnopqrstuvwxyz\n", $n_writers * $n_lines), | ||||
| Filesystem::readFile($tmp)); | Filesystem::readFile($tmp)); | ||||
| ▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines | |||||