diff --git a/CHANGES.txt b/CHANGES.txt index eb9d884f88..3d60231178 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -50,6 +50,7 @@ Merged from 5.0: * Use estimated compressed size for tables to check if there is enough free space for a compaction (CASSANDRA-21245) * Fix failing select on system_views.settings for non-string keys (CASSANDRA-21348) Merged from 4.0: + * Rename conflicting nodetool import --copy-data short option from -p to -cd (CASSANDRA-20214) * Fix PasswordObfuscator failing to obfuscate certain passwords (CASSANDRA-21113) * Fix negative memtable allocator ownership when an update is shadowed by an existing row deletion (CASSANDRA-21469) * Consider first token of SSTable when calculating SSTable intersection in LeveledScanner (CASSANDRA-21369) diff --git a/test/unit/org/apache/cassandra/db/ImportTest.java b/test/unit/org/apache/cassandra/db/ImportTest.java index ee2b870cf9..ee93999a44 100644 --- a/test/unit/org/apache/cassandra/db/ImportTest.java +++ b/test/unit/org/apache/cassandra/db/ImportTest.java @@ -110,7 +110,7 @@ public class ImportTest extends CQLTester // copy is true - so importing will be done by copying importSSTables(SSTableImporter.Options.options(backupDir.toString()).copyData(true).build(), 10); // files are left there as they were just copied - Assert.assertNotEquals(0, countFiles(backupDir)); + assertNotEquals(0, countFiles(backupDir)); } private File prepareBasicImporting() throws Throwable @@ -379,9 +379,9 @@ public class ImportTest extends CQLTester // then we moved out 1 sstable, a correct one (in backupdirCorrect). // now import should fail import on backupdir, but import the one in backupdirCorrect. SSTableImporter.Options options = SSTableImporter.Options.options(Sets.newHashSet(backupdir.toString(), backupdirCorrect.toString())).copyData(copy).verifySSTables(verify).build(); - SSTableImporter importer = new SSTableImporter(getCurrentColumnFamilyStore()); - List failedDirectories = importer.importNewSSTables(options); - assertEquals(Collections.singletonList(backupdir.toString()), failedDirectories); + ToolRunner.ToolResult result = assertImportFailed(getCurrentColumnFamilyStore(), options); + assertThat(result.getStderr()).contains("Some directories failed to import, check server logs for details"); + assertThat(result.getStderr()).contains(backupdir.toString()); UntypedResultSet res = execute("SELECT * FROM %s"); for (UntypedResultSet.Row r : res) { @@ -717,7 +717,7 @@ public class ImportTest extends CQLTester assertEquals(10, execute(String.format("select * from %s.%s", KEYSPACE, table)).size()); // files are left there as they were just copied - Assert.assertNotEquals(0, countFiles(backupDir)); + assertNotEquals(0, countFiles(backupDir)); } finally { @@ -759,7 +759,7 @@ public class ImportTest extends CQLTester assertEquals(10, execute(String.format("select * from %s.%s", KEYSPACE, table)).size()); // files are left there as they were just copied - Assert.assertNotEquals(0, countFiles(backupDir)); + assertNotEquals(0, countFiles(backupDir)); } finally {