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

Neil Conway updated MESOS-4445:
-------------------------------
    Description: 
{noformat}
TEST(RevocableResourceTest, LabelSemantics)
{
  Labels labels1;
  Labels labels2;

  labels1.add_labels()->CopyFrom(createLabel("foo", "bar"));
  labels1.add_labels()->CopyFrom(createLabel("foo", "bar"));

  labels2.add_labels()->CopyFrom(createLabel("foo", "bar"));
  labels2.add_labels()->CopyFrom(createLabel("baz", "qux"));

  bool eq = (labels1 == labels2);
  LOG(INFO) << "Equal? " << (eq ? "true" : "false");
}
{noformat}

Output:
{noformat}
[ RUN      ] RevocableResourceTest.LabelSemantics
I0120 13:15:25.207223 2078158848 resources_tests.cpp:1990] Equal? true
[       OK ] RevocableResourceTest.LabelSemantics (0 ms)
{noformat}

This behavior seems pretty problematic.

  was:
{noformat}
TEST(RevocableResourceTest, LabelSemantics)
{
  Labels labels1;
  Labels labels2;

  labels1.add_labels()->CopyFrom(createLabel("foo", "bar"));
  labels1.add_labels()->CopyFrom(createLabel("foo", "bar"));

  labels2.add_labels()->CopyFrom(createLabel("foo", "bar"));
  labels2.add_labels()->CopyFrom(createLabel("baz", "qux"));

  bool eq = (labels1 == labels2);
  LOG(INFO) << "Equal? " << (eq ? "true" : "false");
}
{noformat}

Output:
{noformat}
[ RUN      ] RevocableResourceTest.LabelSemantics
I0120 13:15:25.207223 2078158848 resources_tests.cpp:1990] Equal? true
[       OK ] RevocableResourceTest.LabelSemantics (0 ms)
{noformat}

This behavior seems pretty problematic. The result also changes if you reorder 
the entries in the second {{Labels}} object---a {{Labels}} object is not 
supposed to be order-sensitive.


> Labels equality behavior is wrong
> ---------------------------------
>
>                 Key: MESOS-4445
>                 URL: https://issues.apache.org/jira/browse/MESOS-4445
>             Project: Mesos
>          Issue Type: Bug
>          Components: general
>            Reporter: Neil Conway
>              Labels: labels, mesosphere
>
> {noformat}
> TEST(RevocableResourceTest, LabelSemantics)
> {
>   Labels labels1;
>   Labels labels2;
>   labels1.add_labels()->CopyFrom(createLabel("foo", "bar"));
>   labels1.add_labels()->CopyFrom(createLabel("foo", "bar"));
>   labels2.add_labels()->CopyFrom(createLabel("foo", "bar"));
>   labels2.add_labels()->CopyFrom(createLabel("baz", "qux"));
>   bool eq = (labels1 == labels2);
>   LOG(INFO) << "Equal? " << (eq ? "true" : "false");
> }
> {noformat}
> Output:
> {noformat}
> [ RUN      ] RevocableResourceTest.LabelSemantics
> I0120 13:15:25.207223 2078158848 resources_tests.cpp:1990] Equal? true
> [       OK ] RevocableResourceTest.LabelSemantics (0 ms)
> {noformat}
> This behavior seems pretty problematic.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to