Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-4035

Spurious NamespacesIT.verifyConstraintInheritance failure

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.5, 1.7.1, 1.8.0
    • Component/s: test
    • Labels:
      None

      Description

      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)
      

      Which lines up with the following code, the assertion failure happening on the fail()

          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());
          }
      

      Looks like this is just another case where a test poorly makes assumptions about ZK propagation.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                elserj Josh Elser
                Reporter:
                elserj Josh Elser
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h