[
https://issues.apache.org/jira/browse/MESOS-6717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15727194#comment-15727194
]
Joseph Wu commented on MESOS-6717:
----------------------------------
{code}
commit 007f91b49060384a9f5c14375b40688d1b89c0bf
Author: Alex Clemmer <[email protected]>
Date: Tue Dec 6 13:37:27 2016 -0800
Stout: Fixed two bugs in `mkdtemp` that block Windows tests.
Currently there are two bugs in the Windows implementation of
`os::mkdtemp`, which together cause all agent tests to fail. We describe
these bugs below and explain the steps this commit will take to address
them.
The first concerns a mismatch between the POSIX specification of
`mkdtemp` and the Windows implementation of `os::mkdtemp`. Specifically,
the POSIX specification indicates that, if any component of the path
prefix in the directory pattern passed to `mkdtemp` does not exist, we
are to set `errno` to `ENOENT` and return a null pointer. In the Stout
POSIX wrapper, `os::mkdtemp`, we will return an `ErrnoError`. In
contrast, the Windows implementation will erroneously recursively create
all components of the path prefix. This commit will address this by
explicitly setting the `recursive` flag of the call to `os::mkdir` to
`false`.
The second concerns a failure to parse Unix-like paths when creating the
temporary directory. Specifically, both the POSIX and Windows
implementations of `os::mkdtemp` have a default argument: `/tmp/XXXXXX`.
When we replace the 'X' characters with random alphanumeric characters
and pass the result to `os::mkdir`, and when the `recursive` flag is
errorneously set to `true`, we will fail to parse the path on Windows,
because `os::mkdir` can only pass Windows-style paths, with the '\'
character. This causes all Agent tests to fail, e.g., when we try to
create sandbox directories.
Technically, this second issue is actually resolved by setting the
`recursive` flag to `false` in the call to `os::mkdir`, but here we
observe that `/tmp` is not the "right place" to put temporary files on
Windows anyway, and so we take the time to clean it up here, by
replacing the default string literal path `/tmp/XXXXXX` with the
platform-agnostic `path::join(os::temp(), "XXXXXX)`.
Review: https://reviews.apache.org/r/54415/
{code}
{code}
commit cd1ad28e3baafa22f108830907819be0d727a6b0
Author: Alex Clemmer <[email protected]>
Date: Tue Dec 6 14:40:02 2016 -0800
Windows: Enabled build of Agent test harness.
This commit adds the Agent test harness to the Windows builds. This is
the first major step towards lighting up comprehensive Agent testing on
agent builds, an important step that has been prevented by a variety of
issues (e.g., things like getting the Master to work for at least
developer scenarios, and so on).
This includes no tests, only the test infrastructure.
Review: https://reviews.apache.org/r/54395/
{code}
> Add Windows support to agent test harness
> -----------------------------------------
>
> Key: MESOS-6717
> URL: https://issues.apache.org/jira/browse/MESOS-6717
> Project: Mesos
> Issue Type: Bug
> Components: agent
> Reporter: Alex Clemmer
> Assignee: Alex Clemmer
> Labels: microsoft, windows-mvp
>
> Of particular interest is in `src/tests/CMakeLists.txt` is support enough of
> the following that we can successfully run agent tests:
> TEST_HELPER_SRC
> MESOS_TESTS_UTILS_SRC
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)