You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Andrew Schwartzmeyer <an...@schwartzmeyer.com> on 2018/05/02 18:29:13 UTC

Review Request 66912: Resolved the `realpath` of the sandbox directory in tests.

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

Review request for mesos, Chun-Hung Hsiao, Joseph Wu, and Jan Schlicht.


Bugs: MESOS-8868
    https://issues.apache.org/jira/browse/MESOS-8868


Repository: mesos


Description
-------

This fixes test failures on systems (like macOS) where `/tmp` is a
symlink. One such scenario is a test which makes a file in the
sandbox, then makes a symlink to the file, and finally compares the
realpath of the symlink to the file. If the part of the path of the
original file in the sandbox is a symlink, this will cause the test to
fail. The fact that the sandbox path is not a fully resolved file name
is confusing. By instead getting the `realpath` of the sandbox during
setup, we can fix the current test failures, and avoid future ones.


Diffs
-----

  3rdparty/stout/include/stout/tests/utils.hpp bfbaa01514214c15f7d62742d37bfd8fa4514974 


Diff: https://reviews.apache.org/r/66912/diff/1/


Testing
-------

stout-tests and libprocess-tests on a MacBook (mesos-tests is still building)


Thanks,

Andrew Schwartzmeyer


Re: Review Request 66912: Resolved the `realpath` of the sandbox directory in tests.

Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66912/#review202320
-----------------------------------------------------------


Ship it!




Ship It!

- Chun-Hung Hsiao


On May 2, 2018, 6:29 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66912/
> -----------------------------------------------------------
> 
> (Updated May 2, 2018, 6:29 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao, Joseph Wu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-8868
>     https://issues.apache.org/jira/browse/MESOS-8868
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This fixes test failures on systems (like macOS) where `/tmp` is a
> symlink. One such scenario is a test which makes a file in the
> sandbox, then makes a symlink to the file, and finally compares the
> realpath of the symlink to the file. If a part of the path of the
> original file in the sandbox is a symlink, this will cause the test to
> fail. The fact that the sandbox path is not a fully resolved file name
> is confusing. By instead getting the `realpath` of the sandbox during
> setup, we can fix the current test failures, and avoid future ones.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/tests/utils.hpp bfbaa01514214c15f7d62742d37bfd8fa4514974 
> 
> 
> Diff: https://reviews.apache.org/r/66912/diff/1/
> 
> 
> Testing
> -------
> 
> stout-tests and libprocess-tests on a MacBook (mesos-tests is still building)
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 66912: Resolved the `realpath` of the sandbox directory in tests.

Posted by Andrew Schwartzmeyer <an...@schwartzmeyer.com>.

> On May 2, 2018, 12:03 p.m., Chun-Hung Hsiao wrote:
> > Do you know what are the tests that compare the real paths? I was wondering if we should just fix those tests for self-containedness.

They are the tests listed in the attached bug, plus previous tests that had to be "fixed" like that which I could pull out of the repo's history if you'd like.

I think we should fix it like this, rather than manually fix each test, because I believe it's a common assumption that the `sandbox` (which is a temporary directory) is a fully resolved path.


> On May 2, 2018, 12:03 p.m., Chun-Hung Hsiao wrote:
> > 3rdparty/stout/include/stout/tests/utils.hpp
> > Lines 50 (patched)
> > <https://reviews.apache.org/r/66912/diff/1/?file=2015943#file2015943line51>
> >
> >     Suggestion:
> >     ```
> >     ASSERT_SOME(realpath)
> >       << "Failed to get realpath of '" << directory.get() << "': "
> >       << (realpath.isError() ? realpath.error() : "No such directory");
> >     ```

This failure is so unlikely... but I can add that.


- Andrew


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


On May 2, 2018, 11:29 a.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66912/
> -----------------------------------------------------------
> 
> (Updated May 2, 2018, 11:29 a.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao, Joseph Wu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-8868
>     https://issues.apache.org/jira/browse/MESOS-8868
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This fixes test failures on systems (like macOS) where `/tmp` is a
> symlink. One such scenario is a test which makes a file in the
> sandbox, then makes a symlink to the file, and finally compares the
> realpath of the symlink to the file. If a part of the path of the
> original file in the sandbox is a symlink, this will cause the test to
> fail. The fact that the sandbox path is not a fully resolved file name
> is confusing. By instead getting the `realpath` of the sandbox during
> setup, we can fix the current test failures, and avoid future ones.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/tests/utils.hpp bfbaa01514214c15f7d62742d37bfd8fa4514974 
> 
> 
> Diff: https://reviews.apache.org/r/66912/diff/1/
> 
> 
> Testing
> -------
> 
> stout-tests and libprocess-tests on a MacBook (mesos-tests is still building)
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 66912: Resolved the `realpath` of the sandbox directory in tests.

Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66912/#review202302
-----------------------------------------------------------



Do you know what are the tests that compare the real paths? I was wondering if we should just fix those tests for self-containedness.


3rdparty/stout/include/stout/tests/utils.hpp
Lines 50 (patched)
<https://reviews.apache.org/r/66912/#comment284074>

    Suggestion:
    ```
    ASSERT_SOME(realpath)
      << "Failed to get realpath of '" << directory.get() << "': "
      << (realpath.isError() ? realpath.error() : "No such directory");
    ```


- Chun-Hung Hsiao


On May 2, 2018, 6:29 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66912/
> -----------------------------------------------------------
> 
> (Updated May 2, 2018, 6:29 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao, Joseph Wu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-8868
>     https://issues.apache.org/jira/browse/MESOS-8868
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This fixes test failures on systems (like macOS) where `/tmp` is a
> symlink. One such scenario is a test which makes a file in the
> sandbox, then makes a symlink to the file, and finally compares the
> realpath of the symlink to the file. If a part of the path of the
> original file in the sandbox is a symlink, this will cause the test to
> fail. The fact that the sandbox path is not a fully resolved file name
> is confusing. By instead getting the `realpath` of the sandbox during
> setup, we can fix the current test failures, and avoid future ones.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/tests/utils.hpp bfbaa01514214c15f7d62742d37bfd8fa4514974 
> 
> 
> Diff: https://reviews.apache.org/r/66912/diff/1/
> 
> 
> Testing
> -------
> 
> stout-tests and libprocess-tests on a MacBook (mesos-tests is still building)
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 66912: Resolved the `realpath` of the sandbox directory in tests.

Posted by Mesos Reviewbot <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66912/#review202317
-----------------------------------------------------------



Patch looks great!

Reviews applied: [66912]

Passed command: export OS='ubuntu:14.04' BUILDTOOL='autotools' COMPILER='gcc' CONFIGURATION='--verbose --disable-libtool-wrappers' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker-build.sh

- Mesos Reviewbot


On May 2, 2018, 6:29 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66912/
> -----------------------------------------------------------
> 
> (Updated May 2, 2018, 6:29 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao, Joseph Wu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-8868
>     https://issues.apache.org/jira/browse/MESOS-8868
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This fixes test failures on systems (like macOS) where `/tmp` is a
> symlink. One such scenario is a test which makes a file in the
> sandbox, then makes a symlink to the file, and finally compares the
> realpath of the symlink to the file. If a part of the path of the
> original file in the sandbox is a symlink, this will cause the test to
> fail. The fact that the sandbox path is not a fully resolved file name
> is confusing. By instead getting the `realpath` of the sandbox during
> setup, we can fix the current test failures, and avoid future ones.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/tests/utils.hpp bfbaa01514214c15f7d62742d37bfd8fa4514974 
> 
> 
> Diff: https://reviews.apache.org/r/66912/diff/1/
> 
> 
> Testing
> -------
> 
> stout-tests and libprocess-tests on a MacBook (mesos-tests is still building)
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>


Re: Review Request 66912: Resolved the `realpath` of the sandbox directory in tests.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/66912/#review202315
-----------------------------------------------------------



FAIL: Some of the unit tests failed. Please check the relevant logs.

Reviews applied: `['66912']`

Failed command: `Start-MesosCITesting`

All the build artifacts available at: http://dcos-win.westus.cloudapp.azure.com/mesos-build/review/66912

Relevant logs:

- [mesos-tests-stdout.log](http://dcos-win.westus.cloudapp.azure.com/mesos-build/review/66912/logs/mesos-tests-stdout.log):

```
[----------] 9 tests from Endpoint/SlaveEndpointTest (1180 ms total)

[----------] 2 tests from ContainerizerType/DefaultContainerDNSFlagTest
[ RUN      ] ContainerizerType/DefaultContainerDNSFlagTest.ValidateFlag/0
[       OK ] ContainerizerType/DefaultContainerDNSFlagTest.ValidateFlag/0 (35 ms)
[ RUN      ] ContainerizerType/DefaultContainerDNSFlagTest.ValidateFlag/1
[       OK ] ContainerizerType/DefaultContainerDNSFlagTest.ValidateFlag/1 (38 ms)
[----------] 2 tests from ContainerizerType/DefaultContainerDNSFlagTest (75 ms total)

[----------] 1 test from IsolationFlag/CpuIsolatorTest
[ RUN      ] IsolationFlag/CpuIsolatorTest.ROOT_UserCpuUsage/0
[       OK ] IsolationFlag/CpuIsolatorTest.ROOT_UserCpuUsage/0 (715 ms)
[----------] 1 test from IsolationFlag/CpuIsolatorTest (748 ms total)

[----------] 1 test from IsolationFlag/MemoryIsolatorTest
[ RUN      ] IsolationFlag/MemoryIsolatorTest.ROOT_MemUsage/0
[       OK ] IsolationFlag/MemoryIsolatorTest.ROOT_MemUsage/0 (806 ms)
[----------] 1 test from IsolationFlag/MemoryIsolatorTest (829 ms total)

[----------] Global test environment tear-down
[==========] 970 tests from 95 test cases ran. (464539 ms total)
[  PASSED  ] 968 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] ContentType/ResourceProviderManagerHttpApiTest.ResubscribeResourceProvider/0, where GetParam() = application/x-protobuf
[  FAILED  ] ContentType/ResourceProviderManagerHttpApiTest.ResubscribeResourceProvider/1, where GetParam() = application/json

 2 FAILED TESTS
  YOU HAVE 216 DISABLED TESTS

```

- [mesos-tests-stderr.log](http://dcos-win.westus.cloudapp.azure.com/mesos-build/review/66912/logs/mesos-tests-stderr.log):

```
I0502 20:00:35.582355  8272 master.cpp:10547] Updating the state of task 8d112540-b704-420c-89a9-fc873e662ba8 of framework 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-0000 (latest state: TASK_KILLED, status update state: TASK_KILLED)
I0502 20:00:35.582355  8248 slave.cpp:3935] Shutting down framework 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-0000
I0502 20:00:35.582355  8248 slave.cpp:6644] Shutting down executor '8d112540-b704-420c-89a9-fc873e662ba8' of framework 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-0000 at executor(1)@10.3.1.8:51578
I0502 20:00:35.584478  8248 slave.cpp:929] Agent terminating
W0502 20:00:35.584478  8248 slave.cpp:3931] Ignoring shutdown framework 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-0000 because it is terminating
I0502 20:00:35.585350  8272 master.cpp:10646] Removing task 8dI0502 20:00:35.374378  2756 exec.cpp:162] Version: 1.6.0
I0502 20:00:35.402344  5900 exec.cpp:236] Executor registered on agent 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-S0
I0502 20:00:35.406344 10704 executor.cpp:177] Received SUBSCRIBED event
I0502 20:00:35.411345 10704 executor.cpp:181] Subscribed executor on winbldsrv-01.zq4gs31qjdiunm1ryi1452nvnh.dx.internal.cloudapp.net
I0502 20:00:35.411345 10704 executor.cpp:177] Received LAUNCH event
I0502 20:00:35.417341 10704 executor.cpp:649] Starting task 8d112540-b704-420c-89a9-fc873e662ba8
I0502 20:00:35.538343 10704 executor.cpp:484] Running 'D:\DCOS\mesos\src\mesos-containerizer.exe launch <POSSIBLY-SENSITIVE-DATA>'
I0502 20:00:35.554347 10704 executor.cpp:662] Forked command at 14308
I0502 20:00:35.584478 12156 exec.cpp:445] Executor asked to shutdown
I0502 20:00:35.585350 12900 executor.cpp:177] Received SHUTDOWN event
I0502 20:00:35.585350 12900 executor.cpp:759] Shutting down
I0502 20:00:35.585350 12900 executor.cpp:869] Sending SIGTERM to process tree at pid 112540-b704-420c-89a9-fc873e662ba8 with resources cpus(allocated: *):4; mem(allocated: *):2048; disk(allocated: *):1024; ports(allocated: *):[31000-32000] of framework 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-0000 on agent 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-S0 at slave(438)@10.3.1.8:51557 (winbldsrv-01.zq4gs31qjdiunm1ryi1452nvnh.dx.internal.cloudapp.net)
I0502 20:00:35.588374  8272 master.cpp:1296] Agent 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-S0 at slave(438)@10.3.1.8:51557 (winbldsrv-01.zq4gs31qjdiunm1ryi1452nvnh.dx.internal.cloudapp.net) disconnected
I0502 20:00:35.588374  8272 master.cpp:3296] Disconnecting agent 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-S0 at slave(438)@10.3.1.8:51557 (winbldsrv-01.zq4gs31qjdiunm1ryi1452nvnh.dx.internal.cloudapp.net)
I0502 20:00:35.588374  8272 master.cpp:3315] Deactivating agent 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-S0 at slave(438)@10.3.1.8:51557 (winbldsrv-01.zq4gs31qjdiunm1ryi1452nvnh.dx.internal.cloudapp.net)
I0502 20:00:35.589344 10220 hierarchical.cpp:344] Removed framework 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-0000
I0502 20:00:35.589344   128 containerizer.cpp:2378] Destroying container c583aefa-171b-4167-86cc-6207efe89663 in RUNNING state
I0502 20:00:35.589344   128 containerizer.cpp:2992] Transitioning the state of container c583aefa-171b-4167-86cc-6207efe89663 from RUNNING to DESTROYING
I0502 20:00:35.589344 10220 hierarchical.cpp:766] Agent 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-S0 deactivated
I0502 20:00:35.590348   128 launcher.cpp:156] Asked to destroy container c583aefa-171b-4167-86cc-6207efe89663
I0502 20:00:35.632385  3940 containerizer.cpp:2831] Container c583aefa-171b-4167-86cc-6207efe89663 has exited
I0502 20:00:35.663367 13832 master.cpp:1138] Master terminating
I0502 20:00:35.666363 11604 hierarchical.cpp:609] Removed agent 70ed2bc4-0bec-46fe-8c23-02cd02c8b772-S0
I0502 20:00:36.053383 13864 process.cpp:940] Stopped the socket accept loop
```

- Mesos Reviewbot Windows


On May 2, 2018, 8:29 p.m., Andrew Schwartzmeyer wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/66912/
> -----------------------------------------------------------
> 
> (Updated May 2, 2018, 8:29 p.m.)
> 
> 
> Review request for mesos, Chun-Hung Hsiao, Joseph Wu, and Jan Schlicht.
> 
> 
> Bugs: MESOS-8868
>     https://issues.apache.org/jira/browse/MESOS-8868
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This fixes test failures on systems (like macOS) where `/tmp` is a
> symlink. One such scenario is a test which makes a file in the
> sandbox, then makes a symlink to the file, and finally compares the
> realpath of the symlink to the file. If a part of the path of the
> original file in the sandbox is a symlink, this will cause the test to
> fail. The fact that the sandbox path is not a fully resolved file name
> is confusing. By instead getting the `realpath` of the sandbox during
> setup, we can fix the current test failures, and avoid future ones.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/tests/utils.hpp bfbaa01514214c15f7d62742d37bfd8fa4514974 
> 
> 
> Diff: https://reviews.apache.org/r/66912/diff/1/
> 
> 
> Testing
> -------
> 
> stout-tests and libprocess-tests on a MacBook (mesos-tests is still building)
> 
> 
> Thanks,
> 
> Andrew Schwartzmeyer
> 
>