> On Oct. 24, 2018, 11:31 p.m., Till Toenshoff wrote:
> > src/tests/fetcher_tests.cpp
> > Lines 105-106 (patched)
> > <https://reviews.apache.org/r/69146/diff/2/?file=2102314#file2102314line105>
> >
> >     While this solution appears to be the most efficient it also is not 
> > entirely consistent with how we do it in other places; 
> >     Note that `getcwd()` returns the test-sandbox directory after the 
> > fixture did its job.
> >     ```
> >     path::join(os::getcwd(), "fetcher");
> >     path::join(os::getcwd(), "frameworks");
> >     ```
> >     would be consistent.
> >     
> >     Alternatively, we could at least do away with one `CHECK_NOTNONE` and 
> > pull it in front of these two uses of `sandbox`.
> 
> Joseph Wu wrote:
>     A good chunk of tests have the following pattern:
>     ```
>     path::join(sandbox.get(), ...);
>     ```
>     
>     I've been leaning towards this because it forgoes the syscall.
> 
> Till Toenshoff wrote:
>     Definitely more efficient, yes - wish we could "fix" that in one swoop - 
> but am not attached to the first part of my comment due to these reasons.
> 
> Meng Zhu wrote:
>     For the second part, I think using two `CHECK_NOTNONE` is more readable 
> to me. Otherwise, we will end up with two unguarded `get()` (I am a little 
> bit allergic to unguarded `get()` :) )

How about 
```
CHECK_NOTNONE(sandbox);
flags.fetcher_cache_dir = path::join(sandbox.get(), "fetcher");
flags.frameworks_home = path::join(sandbox.get(), "frameworks");
```


- Till


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


On Oct. 24, 2018, 11:12 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/69146/
> -----------------------------------------------------------
> 
> (Updated Oct. 24, 2018, 11:12 p.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Chun-Hung Hsiao, Gilbert Song, 
> and Till Toenshoff.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Fetcher tests currently rely on some hard-coded paths,
> for example, `/tmp/mesos/fetcher` and `/tmp/frameworks`.
> Thus fetcher tests could fail if these directories already
> exit. This patch adds a helper function `createSlaveFlags()`
> to make use of the test sandboxes. The above paths will be
> replaced by `fetch/` and `frameworks/` under the sandbox.
> 
> 
> Diffs
> -----
> 
>   src/tests/fetcher_tests.cpp 283238cdda17a94e034baa195bd9d4b57e363b8a 
> 
> 
> Diff: https://reviews.apache.org/r/69146/diff/2/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>

Reply via email to