Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.apache.tsfile.write.schema.MeasurementSchema;
import org.apache.tsfile.write.v4.ITsFileWriter;
import org.apache.tsfile.write.v4.TsFileWriterBuilder;
import org.awaitility.Awaitility;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Assert;
Expand All @@ -67,6 +68,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Expand Down Expand Up @@ -1703,20 +1705,28 @@ public void dropTableOfTheSameNameTest()

session.executeNonQueryStatement("DROP TABLE db2.table" + testNum);

// DROP TABLE is asynchronous, so wait for deletion to finish instead of observing PRE_DELETE.
Awaitility.await()
.atMost(60, TimeUnit.SECONDS)
.pollInSameThread()
.untilAsserted(
() -> {
try (SessionDataSet ignored =
session.executeQueryStatement(
"select * from db2.table" + testNum + " order by time")) {
fail("expected exception");
} catch (StatementExecutionException e) {
assertEquals("550: Table 'db2.table16' does not exist.", e.getMessage());
}
});

SessionDataSet dataSet =
session.executeQueryStatement("select * from db1.table" + testNum + " order by time");
RowRecord rec = dataSet.next();
assertEquals(1, rec.getFields().get(0).getLongV());
assertEquals("d1", rec.getFields().get(1).toString());
assertEquals(1, rec.getFields().get(2).getIntV());
assertFalse(dataSet.hasNext());

try {
session.executeQueryStatement("select * from db2.table" + testNum + " order by time");
fail("expected exception");
} catch (StatementExecutionException e) {
assertEquals("550: Table 'db2.table16' does not exist.", e.getMessage());
}
}
}

Expand Down
Loading