Closed davepacheco closed 7 years ago
I have a change for review @ https://cr.joyent.us/1488
I added tests. The entire test suite passes, though there were no mget
tests originally. There are now, though:
$ make test TEST_FILTER=mget
...
# Running subset of tests matching TEST_FILTER=mget
mget.test.js
✔ setup: create test tree at /mantatest/stor/node-manta-test-mget-6d70d23a
✔ mget TESTDIR/02.data
✔ mget TESTDIR/01.data TESTDIR/02.data TESTDIR/03.data
✔ mget TESTDIR/01.txt TESTDIR/02.txt TESTDIR/03.txt
✔ mget -o TMPFILE TESTDIR/01.txt TESTDIR/02.txt TESTDIR/03.txt
✔ mget TESTDIR/01.txt TESTDIR/02.txt TESTDIR/XX.txt TESTDIR/03.txt
✔ mget -o TMPFILE TESTDIR/01.txt TESTDIR/02.txt TESTDIR/XX.txt TESTDIR/03.txt
✔ cleanup: rm test tree /mantatest/stor/node-manta-test-mget-6d70d23a
OK: 22 assertions (15382ms)
I created a test directory with three objects:
You can fetch all of these concatenated by passing them all to "mget":
and you can normally redirect mget's output to a file with -o:
but if you combine these, it fails:
I suspect what's going on here is that we pipe the stream for each object into the output file, including its "end" event. We need to not pipe the 'end' event, but instead apply our own .end() to the stream when we've finished with all of the objects.