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

DirectoriesTest fails when run as root

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 2.0.12, 2.1.3
    • Legacy/Testing
    • None
    • Low

    Description

      When you run the DirectoriesTest as a normal user, it passes because it fails to create the 'bad' directory:

          [junit] ------------- Standard Error -----------------
          [junit] ERROR 16:16:18,111 Failed to create /tmp/cassandra4119802552776680052unittest/ks/bad directory
          [junit]  WARN 16:16:18,112 Blacklisting /tmp/cassandra4119802552776680052unittest/ks/bad for writes
          [junit] ------------- ---------------- ---------------
      

      But when you run the test as root, it succeeds in making the directory, causing an assertion failure that it's unwritable:

          [junit] Testcase: testDiskFailurePolicy_best_effort(org.apache.cassandra.db.DirectoriesTest):       FAILED
          [junit] 
          [junit] junit.framework.AssertionFailedError: 
          [junit]     at org.apache.cassandra.db.DirectoriesTest.testDiskFailurePolicy_best_effort(DirectoriesTest.java:199)
      

      It seems to me that we shouldn't be relying on failing the make the directory. If we're just going to test a nonexistent dir, why try to make one at all? And if that is supposed to succeed, then we have a problem with either the test or blacklisting.

      Attachments

        1. 6983-v2.patch
          2 kB
          Alan Boudreault

        Activity

          People

            aboudreault Alan Boudreault
            brandon.williams Brandon Williams
            Alan Boudreault
            Yuki Morishita
            Alan Boudreault Alan Boudreault
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: