> On June 26, 2015, 2:30 a.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.
@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. - haosdent ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/35728/#review89458 ----------------------------------------------------------- On June 27, 2015, 4:37 p.m., haosdent huang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/35728/ > ----------------------------------------------------------- > > (Updated June 27, 2015, 4:37 p.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 > >
