Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-10555

ReadCommandTest should truncate between test cases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 3.2
    • Legacy/Testing
    • None
    • Low

    Description

      ReadCommandTest writes to the same CF in multiple unit tests, and then counts the results in a partition. This can lead to tests failing in some circumstances:

          [junit] Testcase: testSinglePartitionNamesAbort(org.apache.cassandra.db.ReadCommandTest):	FAILED
          [junit] expected:<2> but was:<1>
          [junit] junit.framework.AssertionFailedError: expected:<2> but was:<1>
          [junit] 	at org.apache.cassandra.db.ReadCommandTest.testSinglePartitionNamesAbort(ReadCommandTest.java:140)
          [junit] 
          [junit] 
          [junit] Testcase: testSinglePartitionSliceAbort(org.apache.cassandra.db.ReadCommandTest):	FAILED
          [junit] expected:<2> but was:<3>
          [junit] junit.framework.AssertionFailedError: expected:<2> but was:<3>
          [junit] 	at org.apache.cassandra.db.ReadCommandTest.testSinglePartitionSliceAbort(ReadCommandTest.java:111)
      

      This can be fixed trivially by truncating the CF at the beginning of testSinglePartitionSliceAbort and testSinglePartitionNamesAbort

      Also, once the truncate is in place, a potential typo is exposed in testSinglePartitionNamesAbort, where the partition is written with clustering column cc and cdd, but the read command reads cc and dd

      Attachments

        Activity

          People

            jjirsa Jeff Jirsa
            jjirsa Jeff Jirsa
            Jeff Jirsa
            Stefania Alborghetti
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: