You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Yuki Morishita (JIRA)" <ji...@apache.org> on 2015/01/07 00:12:34 UTC

[jira] [Commented] (CASSANDRA-6983) DirectoriesTest fails when run as root

    [ https://issues.apache.org/jira/browse/CASSANDRA-6983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14266935#comment-14266935 ] 

Yuki Morishita commented on CASSANDRA-6983:
-------------------------------------------

Thanks for the patch.

I like your No.2 approach.
Though I don't think we need to create (another) test-use-only method to Directories.
Instead, you can just do that in test method directory.
Can you update your patch?

> DirectoriesTest fails when run as root
> --------------------------------------
>
>                 Key: CASSANDRA-6983
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6983
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Tests
>            Reporter: Brandon Williams
>            Assignee: Alan Boudreault
>            Priority: Minor
>             Fix For: 2.0.12
>
>         Attachments: 6983-v1.patch
>
>
> When you run the DirectoriesTest as a normal user, it passes because it fails to create the 'bad' directory:
> {noformat}
>     [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] ------------- ---------------- ---------------
> {noformat}
> But when you run the test as root, it succeeds in making the directory, causing an assertion failure that it's unwritable:
> {noformat}
>     [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)
> {noformat}
> 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.



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