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

Josh Elser resolved ACCUMULO-4035.
----------------------------------
    Resolution: Fixed

> Spurious NamespacesIT.verifyConstraintInheritance failure
> ---------------------------------------------------------
>
>                 Key: ACCUMULO-4035
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-4035
>             Project: Accumulo
>          Issue Type: Bug
>          Components: test
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>            Priority: Minor
>             Fix For: 1.6.5, 1.7.1, 1.8.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> {noformat}
> java.lang.AssertionError: null
>       at org.junit.Assert.fail(Assert.java:86)
>       at org.junit.Assert.fail(Assert.java:95)
>       at 
> org.apache.accumulo.test.NamespacesIT.verifyConstraintInheritance(NamespacesIT.java:516)
> {noformat}
> Which lines up with the following code, the assertion failure happening on 
> the {{fail()}}
> {code}
>     c.namespaceOperations().addConstraint(namespace, constraintClassName);
>     
> assertTrue(c.namespaceOperations().listConstraints(namespace).containsKey(constraintClassName));
>     
> assertTrue(c.tableOperations().listConstraints(t1).containsKey(constraintClassName));
>     int num = 
> c.namespaceOperations().listConstraints(namespace).get(constraintClassName);
>     assertEquals(num, (int) 
> c.tableOperations().listConstraints(t1).get(constraintClassName));
>     // doesn't take effect immediately, needs time to propagate to tserver's 
> ZooKeeper cache
>     UtilWaitThread.sleep(250);
>     Mutation m1 = new Mutation("r1");
>     Mutation m2 = new Mutation("r2");
>     Mutation m3 = new Mutation("r3");
>     m1.put("a", "b", new Value("abcde".getBytes(UTF_8)));
>     m2.put("e", "f", new Value("123".getBytes(UTF_8)));
>     m3.put("c", "d", new Value("zyxwv".getBytes(UTF_8)));
>     BatchWriter bw = c.createBatchWriter(t1, new BatchWriterConfig());
>     bw.addMutations(Arrays.asList(m1, m2, m3));
>     try {
>       bw.close();
>       fail();
>     } catch (MutationsRejectedException e) {
>       assertEquals(1, e.getConstraintViolationSummaries().size());
>       assertEquals(2, 
> e.getConstraintViolationSummaries().get(0).getNumberOfViolatingMutations());
>     }
> {code}
> Looks like this is just another case where a test poorly makes assumptions 
> about ZK propagation.



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

Reply via email to