You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Alexander Rukletsov (JIRA)" <ji...@apache.org> on 2017/04/07 12:51:41 UTC

[jira] [Updated] (MESOS-7367) MasterAPITest.GetRoles is flaky on machines with non-C locale.

     [ https://issues.apache.org/jira/browse/MESOS-7367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Rukletsov updated MESOS-7367:
---------------------------------------
    Description: 
{{MasterAPITest.GetRoles}} test sets role weight to a real number using {{.}} as a decimal mark. This however is not correct on machines with non-standard locale, because weight parsing code relies on locale: [https://github.com/apache/mesos/blob/7f04cf886fc2ed59414bf0056a2f351959a2d1f8/src/master/master.cpp#L727-L750]. This leads to test failures: [https://pastebin.com/sQR2Tr2Q].

There are several solutions here.

h4. 1. Change parsing code to be locale-agnostic.
This seems to be the most robust solution. However, the {{--weights}} flag is deprecated and will probably be removed soon, together with the parsing code. 

h4. 2. Fix call sites in our tests to ensure decimal mark is locale dependent.
This seems like a reasonable solution, but I'd argue we can do even better.

h4. 3. Use locale-agnostic format for doubles in tests.
Instead of saying {{"2.5"}} we can say {{"25e-1"}} which is locale agnostic.

  was:
{{MasterAPITest.GetRoles}} test sets role weight to a real number using {{.}} as a decimal mark. This however is not correct on machines with non-standard locale, because weight parsing code relies on locale: [https://github.com/apache/mesos/blob/7f04cf886fc2ed59414bf0056a2f351959a2d1f8/src/master/master.cpp#L727-L750]. This leads to test failures: [https://pastebin.com/sQR2Tr2Q].

There are several solutions here.

h4. Change parsing code to be locale-agnostic.
This seems to be the most robust solution. However, the {{--weights}} flag is deprecated and will probably be removed soon, together with the parsing code. 

h4. Fix call sites in our tests to ensure decimal mark is locale dependent.
This seems like a reasonable solution, but I'd argue we can do even better.

h4. Use locale-agnostic format for doubles in tests.
Instead of saying {{"2.5"}} we can say {{"25e-1"}} which is locale agnostic.


> MasterAPITest.GetRoles is flaky on machines with non-C locale.
> --------------------------------------------------------------
>
>                 Key: MESOS-7367
>                 URL: https://issues.apache.org/jira/browse/MESOS-7367
>             Project: Mesos
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 1.0.2, 1.1.1, 1.2.0
>         Environment: Ubuntu 16.04 with non-C locale
>            Reporter: Alexander Rukletsov
>              Labels: flaky-test, mesosphere, test
>
> {{MasterAPITest.GetRoles}} test sets role weight to a real number using {{.}} as a decimal mark. This however is not correct on machines with non-standard locale, because weight parsing code relies on locale: [https://github.com/apache/mesos/blob/7f04cf886fc2ed59414bf0056a2f351959a2d1f8/src/master/master.cpp#L727-L750]. This leads to test failures: [https://pastebin.com/sQR2Tr2Q].
> There are several solutions here.
> h4. 1. Change parsing code to be locale-agnostic.
> This seems to be the most robust solution. However, the {{--weights}} flag is deprecated and will probably be removed soon, together with the parsing code. 
> h4. 2. Fix call sites in our tests to ensure decimal mark is locale dependent.
> This seems like a reasonable solution, but I'd argue we can do even better.
> h4. 3. Use locale-agnostic format for doubles in tests.
> Instead of saying {{"2.5"}} we can say {{"25e-1"}} which is locale agnostic.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)