-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/50003/#review142393
-----------------------------------------------------------



Regarding the regression test: several of our tests use this "local mode" to 
test example frameworks (see 'src/tests/examples_tests.cpp'), but they all set 
the MESOS_WORK_DIR env var before running. I also noticed that we don't have 
any tests which run the 'mesos-local' binary; I created a separate ticket for 
that: https://issues.apache.org/jira/browse/MESOS-5850.

One easy thing you could do to cover the issue which led to these patches is to 
modify one of the existing example framework test scripts to _not_ set 
MESOS_WORK_DIR before running. This would just involve removing lines like 
[these](https://github.com/apache/mesos/blob/4764768fc781bb99294039cebf072748f190bfba/src/tests/test_framework_test.sh#L25-L26).


src/local/flags.hpp (line 33)
<https://reviews.apache.org/r/50003/#comment207959>

    I was originally put off by the duplication of the `work_dir` flag here, 
since it makes `work_dir` the only normal Mesos master/agent flag that can be 
specified at the command line. Another option I see is to manually check the 
value of `MESOS_WORK_DIR` and then set it via `flags.work_dir = DEFAULT` if 
necessary. However, I think I prefer the method of using our flag objects to 
express the default value rather than manually checking an environment variable.
    
    Anyway! What do you think about adding a comment here explaining why we're 
doing this for `work_dir` but not any other flag? i.e., we need to set 
`work_dir` early because it's a required flag and `load` will barf if it's not 
already set. Local mode is the one case in which we deem it acceptable to use a 
default location within `/tmp` for the `work_dir`.


- Greg Mann


On July 14, 2016, 10:11 p.m., Ammar Askar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/50003/
> -----------------------------------------------------------
> 
> (Updated July 14, 2016, 10:11 p.m.)
> 
> 
> Review request for mesos, Greg Mann and Vinod Kone.
> 
> 
> Bugs: MESOS-5613
>     https://issues.apache.org/jira/browse/MESOS-5613
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Propagate work_dir flag from local runs to agents/masters.
> 
> 
> Diffs
> -----
> 
>   src/local/flags.hpp f0af0d2 
>   src/local/local.cpp a543aef 
> 
> Diff: https://reviews.apache.org/r/50003/diff/
> 
> 
> Testing
> -------
> 
> Manually tested that `mesos local` and `mesos-local` run now. Not sure if a 
> regression test for this would be good, please advise.
> 
> 
> Thanks,
> 
> Ammar Askar
> 
>

Reply via email to