> On June 25, 2015, 7:30 p.m., Adam B wrote: > > Nice work! So, running the command as root first will guarantee that > > lt-mesos-executor exists before trying to run the task as the test-user > > `nobody`? We might be able to fix this in a cleaner way, but this looks > > good enough to me. Just fix the few minor points I raised and update the > > comments, and then I'll commit it. > > > > Please fill out the "Testing Done" section to explain how you verified that > > this test failed before your change and now passes. > > haosdent huang wrote: > @adam-mesos, Thank you very much for your review. You metioned that `We > might be able to fix this in a cleaner way`, could you tell me more details > about it? I think use a more cleaner way to fix this problem could make us > maintain this test case more easier.
I'm not sure exactly how we would do this "cleaner" yet. Maybe use a SetUp/TearDown method that could create `lt-mesos-executor` before the test and then remove it afterwards. But I would call this shippable for now since it does indeed fix the test. We could clean it up later if we come up with something more elegant. - Adam ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/35728/#review89458 ----------------------------------------------------------- On June 27, 2015, 9:37 a.m., haosdent huang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/35728/ > ----------------------------------------------------------- > > (Updated June 27, 2015, 9:37 a.m.) > > > Review request for mesos and Adam B. > > > Bugs: MESOS-2199 > https://issues.apache.org/jira/browse/MESOS-2199 > > > Repository: mesos > > > Description > ------- > > Fix failing test: SlaveTest.ROOT_RunTaskWithCommandInfoWithUser. > > > Diffs > ----- > > src/tests/slave_tests.cpp e9002e807b500503c5bccf7ce638d98643f229ed > > Diff: https://reviews.apache.org/r/35728/diff/ > > > Testing > ------- > > ### 1. Reproduce problem in old code > > ```bash > # Enter mesos source directory and remove build directory > cd mesos && rm -rf build > # Rebuild mesos > mkdir -p build && ./bootstrap && cd build && ../configure > # Run the single test > make -j8 check GTEST_FILTER="SlaveTest.ROOT_RunTaskWithCommandInfoWithUser" > ``` > When running this test case, the mesos containier running under user > `nobody`. And when the containier start `build/src/mesos-executor`, > `build/src/mesos-executor` would check the > `build/src/.libs/lt-mesos-executor` exists or not. Because we never running > other test cases before, `build/src/.libs/lt-mesos-executor` is not exists > here. And then `build/src/mesos-executor` would try to compile and generate > `build/src/.libs/lt-mesos-executor`. Because `build/src/mesos-executor` is > running under user `nobody`, it don't have permissions to output files to > `build` directory. This test cases failed finally. > > ### 2. My way to fix this problem > > I start a prepare task with root first. And after this task finished with > success, we could sure that `build/src/.libs/lt-mesos-executor` is exists. So > when we start `build/src/mesos-executor` with user `nobody`, it not need to > generate `build/src/.libs/lt-mesos-executor`. And then it could finish its > tasks successfully. > > > Thanks, > > haosdent huang > >
