[
https://issues.apache.org/jira/browse/CASSANDRA-9561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14575721#comment-14575721
]
Stefania commented on CASSANDRA-9561:
-------------------------------------
Changing the UUID doesn't help because we pass /tmp as the first parameter to
the Descriptor. We should pass {{cfs.directories.getDirectoryForNewSSTables()}}
and this not only picks up ks name, cf name and uuid, it also puts the files in
parallel folders, {{build/test/cassandra/data:N/mockks}} where N is the test
runner number. This fixes it without even changing ks name or UUID. However we
must clean up the folders, so I've added a call to MockSchema.cleanup() to all
lifecycle tests. The alternative would be to register the folder itself for
delete on exit but I think it could be handy to still have files after the test
has terminated.
Patch for trunk attached.
Pending CI:
http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-9561-testall
http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-9561-dtest
> Lifecycle unit tests fail when run in parallel
> ----------------------------------------------
>
> Key: CASSANDRA-9561
> URL: https://issues.apache.org/jira/browse/CASSANDRA-9561
> Project: Cassandra
> Issue Type: Test
> Reporter: Stefania
> Assignee: Stefania
>
> We had a new failure in TrackerTest:
> http://cassci.datastax.com/view/trunk/job/trunk_testall/139/testReport/junit/org.apache.cassandra.db.lifecycle/TrackerTest/testDropSSTables/
> {code}
> 14:02:05 [junit] Testcase:
> testSSTablesInBounds(org.apache.cassandra.db.lifecycle.ViewTest): FAILED
> 14:02:05 [junit] 0(true) 1(false) expected:<1> but was:<2>
> 14:02:05 [junit] junit.framework.AssertionFailedError: 0(true) 1(false)
> expected:<1> but was:<2>
> 14:02:05 [junit] at
> org.apache.cassandra.db.lifecycle.ViewTest.testSSTablesInBounds(ViewTest.java:65)
> 14:02:05 [junit]
> 14:02:05 [junit]
> 14:02:05 [junit] Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time
> elapsed: 5.58 sec
> 14:02:05 [junit]
> 14:02:05 [junit] ------------- Standard Output ---------------
> 14:02:05 [junit] ERROR 13:57:36 Unable to delete /tmp/la-1-big-Data.db
> (it will be removed on server restart; we'll also retry after GC)
> 14:02:05 [junit] ERROR 13:57:36 Unable to delete /tmp/la-1-big-Data.db
> (it will be removed on server restart; we'll also retry after GC)
> 14:02:05 [junit] ERROR 13:57:36 Unable to delete /tmp/la-2-big-Data.db
> (it will be removed on server restart; we'll also retry after GC)
> 14:02:05 [junit] ERROR 13:57:36 Unable to delete /tmp/la-2-big-Data.db
> (it will be removed on server restart; we'll also retry after GC)
> 14:02:05 [junit] ERROR 13:57:36 Unable to delete /tmp/la-0-big-Data.db
> (it will be removed on server restart; we'll also retry after GC)
> 14:02:05 [junit] ERROR 13:57:36 Unable to delete /tmp/la-0-big-Data.db
> (it will be removed on server restart; we'll also retry after GC)
> 14:02:05 [junit] ------------- ---------------- ---------------
> 14:02:05 [junit] Testcase:
> testDropSSTables(org.apache.cassandra.db.lifecycle.TrackerTest): FAILED
> 14:02:05 [junit] expected:<9> but was:<95>
> 14:02:05 [junit] junit.framework.AssertionFailedError: expected:<9> but
> was:<95>
> 14:02:05 [junit] at
> org.apache.cassandra.db.lifecycle.TrackerTest.testDropSSTables(TrackerTest.java:217)
> 14:02:05 [junit] at
> org.apache.cassandra.db.lifecycle.TrackerTest.testDropSSTables(TrackerTest.java:192)
> {code}
> I could reproduce it easily but *only if running the tests in parallel*:
> {code}
> ant test -Dtest.runners=4 -Dtest.name=lifecycle/*Test
> {code}
> If running with a single JVM then no failures can be detected, not even after
> 50 runs in a loop.
> I think the problem is a collision of file names for the sstables created by
> MockSchema. When a JVM exits files are deleted due to File.deleteOnExit(),
> and a test running in a different JVM and using the same file names may fail.
> This is the only explanation I could think of.
> I propose to place sstable files created by MockSchema in folders unique to
> each test by passing a namespace to MockSchema, equal to the test name.
> cc [~benedict]
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)