[jira] [Commented] (MESOS-8857) Fix subprocess(flags) logic on Windows to handle arguments with quotes
[ https://issues.apache.org/jira/browse/MESOS-8857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16470672#comment-16470672 ] ASF GitHub Bot commented on MESOS-8857: --- GitHub user radhikaj opened a pull request: https://github.com/apache/mesos/pull/289 Fixtestflags Fixing bug described in https://issues.apache.org/jira/browse/MESOS-8857 echo on windows just reproduces the command line args it receives and does not apply any text processing to it. The Flags test in SubProcessTest expects standard text processing to be applied to the command line args. Therefore instead of using echo on windows to test that flags are being fed correctly to a console app, we add test-flags.exe which receives command line args via argv and prints argv's elements out with a space in between. You can merge this pull request into a Git repository by running: $ git pull https://github.com/radhikaj/mesos fixtestflags Alternatively you can review and apply these changes as the patch at: https://github.com/apache/mesos/pull/289.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #289 > Fix subprocess(flags) logic on Windows to handle arguments with quotes > -- > > Key: MESOS-8857 > URL: https://issues.apache.org/jira/browse/MESOS-8857 > Project: Mesos > Issue Type: Bug >Reporter: Andrew Schwartzmeyer >Assignee: Radhika Jandhyala >Priority: Major > Labels: flags, libprocess, windows > > In the {{SubprocessTest.Flags}} unit test, a bug was discovered where the > flags argument {{flags.s3 = "\"geek\"";}} does not make it round-trip back to > the test. It is because the {{stringify_args}} logic in {{shell.hpp}} > purposefully (correctly?) surrounds an argument that contains a double quote > with a pair of double quotes. Thus the final command-line flag looks like > {{"\"--s3=\\\"geek\\\"\""}}, which {{flags.load()}} then fails to reparse. > The same problem occurs for the (more complicated) JSON flag. > I believe this is because the original logic was expecting the shell to drop > the quotes ({{echo "--s3=\"geek\""}} in Bash returns {{--s3="geek"}}, but > {{cmd.exe}} echos {{"--s3=\"geek\""}}, exactly what was passed. Maybe the > test just needs to be fixed; maybe the stringifier shouldn't add more quotes; > maybe {{flags.load()}} needs to parse the quotes and escapes. > For now, we're enabling the rest of the test by turning off those two checks. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MESOS-8857) Fix subprocess(flags) logic on Windows to handle arguments with quotes
[ https://issues.apache.org/jira/browse/MESOS-8857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16469564#comment-16469564 ] ASF GitHub Bot commented on MESOS-8857: --- Github user radhikaj closed the pull request at: https://github.com/apache/mesos/pull/288 > Fix subprocess(flags) logic on Windows to handle arguments with quotes > -- > > Key: MESOS-8857 > URL: https://issues.apache.org/jira/browse/MESOS-8857 > Project: Mesos > Issue Type: Bug >Reporter: Andrew Schwartzmeyer >Assignee: Radhika Jandhyala >Priority: Major > Labels: flags, libprocess, windows > > In the {{SubprocessTest.Flags}} unit test, a bug was discovered where the > flags argument {{flags.s3 = "\"geek\"";}} does not make it round-trip back to > the test. It is because the {{stringify_args}} logic in {{shell.hpp}} > purposefully (correctly?) surrounds an argument that contains a double quote > with a pair of double quotes. Thus the final command-line flag looks like > {{"\"--s3=\\\"geek\\\"\""}}, which {{flags.load()}} then fails to reparse. > The same problem occurs for the (more complicated) JSON flag. > I believe this is because the original logic was expecting the shell to drop > the quotes ({{echo "--s3=\"geek\""}} in Bash returns {{--s3="geek"}}, but > {{cmd.exe}} echos {{"--s3=\"geek\""}}, exactly what was passed. Maybe the > test just needs to be fixed; maybe the stringifier shouldn't add more quotes; > maybe {{flags.load()}} needs to parse the quotes and escapes. > For now, we're enabling the rest of the test by turning off those two checks. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (MESOS-8857) Fix subprocess(flags) logic on Windows to handle arguments with quotes
[ https://issues.apache.org/jira/browse/MESOS-8857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16469563#comment-16469563 ] ASF GitHub Bot commented on MESOS-8857: --- GitHub user radhikaj opened a pull request: https://github.com/apache/mesos/pull/288 Fixtestflags https://issues.apache.org/jira/browse/MESOS-8857 You can merge this pull request into a Git repository by running: $ git pull https://github.com/radhikaj/mesos fixtestflags Alternatively you can review and apply these changes as the patch at: https://github.com/apache/mesos/pull/288.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #288 commit 9d895daf4bcd27e6929b03a95e7cef8002876f59 Author: Radhika JandhyalaDate: 2018-05-09T21:09:34Z Fix TEST_F(SubprocessTest, Flags) commit 0c60122764d5923c8e7255516042bd26787a1ff5 Author: Radhika Jandhyala Date: 2018-05-09T21:51:20Z run clang-format > Fix subprocess(flags) logic on Windows to handle arguments with quotes > -- > > Key: MESOS-8857 > URL: https://issues.apache.org/jira/browse/MESOS-8857 > Project: Mesos > Issue Type: Bug >Reporter: Andrew Schwartzmeyer >Assignee: Radhika Jandhyala >Priority: Major > Labels: flags, libprocess, windows > > In the {{SubprocessTest.Flags}} unit test, a bug was discovered where the > flags argument {{flags.s3 = "\"geek\"";}} does not make it round-trip back to > the test. It is because the {{stringify_args}} logic in {{shell.hpp}} > purposefully (correctly?) surrounds an argument that contains a double quote > with a pair of double quotes. Thus the final command-line flag looks like > {{"\"--s3=\\\"geek\\\"\""}}, which {{flags.load()}} then fails to reparse. > The same problem occurs for the (more complicated) JSON flag. > I believe this is because the original logic was expecting the shell to drop > the quotes ({{echo "--s3=\"geek\""}} in Bash returns {{--s3="geek"}}, but > {{cmd.exe}} echos {{"--s3=\"geek\""}}, exactly what was passed. Maybe the > test just needs to be fixed; maybe the stringifier shouldn't add more quotes; > maybe {{flags.load()}} needs to parse the quotes and escapes. > For now, we're enabling the rest of the test by turning off those two checks. -- This message was sent by Atlassian JIRA (v7.6.3#76005)