----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/54497/#review158388 -----------------------------------------------------------
src/tests/api_tests.cpp (line 3990) <https://reviews.apache.org/r/54497/#comment229147> why is this an Option? src/tests/api_tests.cpp (line 4065) <https://reviews.apache.org/r/54497/#comment229149> s/message/processIO/ src/tests/api_tests.cpp (line 4084) <https://reviews.apache.org/r/54497/#comment229150> s/message/processIO/ src/tests/api_tests.cpp (lines 4094 - 4118) <https://reviews.apache.org/r/54497/#comment229151> can't we use http::post() here? would be nice to add support to send streaming request to that function. src/tests/api_tests.cpp (lines 4121 - 4146) <https://reviews.apache.org/r/54497/#comment229177> so this looks different from how we read piped records in io switchboard tests (and also my review). this is how it looks: ``` http::Pipe::Reader reader = response->reader.get(); auto deserializer = lambda::bind(deserialize<v1::agent::ProcessIO>, contentType, lambda::_1); Reader<v1::agent::ProcessIO> decoder( ::recordio::Decoder<v1::agent::ProcessIO>(deserializer), reader); string stdoutReceived = ""; string stderrReceived = ""; while (true) { Future<Result<v1::agent::ProcessIO>> _message = decoder.read(); AWAIT_READY(_message); if (_message->isNone()) { break; } ASSERT_SOME(_message.get()); v1::agent::ProcessIO message = _message->get(); ASSERT_EQ(v1::agent::ProcessIO::DATA, message.type()); ASSERT_TRUE(message.data().type() == v1::agent::ProcessIO::Data::STDOUT || message.data().type() == v1::agent::ProcessIO::Data::STDERR); if (message.data().type() == v1::agent::ProcessIO::Data::STDOUT) { stdoutReceived += message.data().data(); } else if (message.data().type() == v1::agent::ProcessIO::Data::STDERR) { stderrReceived += message.data().data(); } } EXPECT_EQ(output, stdoutReceived); EXPECT_EQ(error, stderrReceived); ``` maybe we should write an helper so that we can standardize and de-duplicate. how about ``` // Reads ProcessIO::Data records for the pipe `reader` until EOF is reached and returns // merged stdout and stderr as a tuple. Note: It ignores any ProcessIO::Control records. Try<tuple<string, string>> getProcessIOData(http::Pipe::Reader reader) { } ``` - Vinod Kone On Dec. 7, 2016, 8:15 p.m., Anand Mazumdar wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/54497/ > ----------------------------------------------------------- > > (Updated Dec. 7, 2016, 8:15 p.m.) > > > Review request for mesos and Vinod Kone. > > > Repository: mesos > > > Description > ------- > > Added a test for the 'ATTACH_CONTAINER_INPUT' call. > > > Diffs > ----- > > src/tests/api_tests.cpp 6cd1f83a47731ee8c4fb1f022bf585b271b3b966 > > Diff: https://reviews.apache.org/r/54497/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Anand Mazumdar > >
