Remove race condition in CsvTest

Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/5bc0e0e5
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/5bc0e0e5
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/5bc0e0e5

Branch: refs/heads/master
Commit: 5bc0e0e536bd12d8c1551271097af229e68c88c6
Parents: d9eb438
Author: Julian Hyde <[email protected]>
Authored: Thu Jul 7 23:41:55 2016 -0700
Committer: Julian Hyde <[email protected]>
Committed: Thu Jul 7 23:44:51 2016 -0700

----------------------------------------------------------------------
 example/csv/src/test/java/org/apache/calcite/test/CsvTest.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/5bc0e0e5/example/csv/src/test/java/org/apache/calcite/test/CsvTest.java
----------------------------------------------------------------------
diff --git a/example/csv/src/test/java/org/apache/calcite/test/CsvTest.java 
b/example/csv/src/test/java/org/apache/calcite/test/CsvTest.java
index 353758a..dbb52d5 100644
--- a/example/csv/src/test/java/org/apache/calcite/test/CsvTest.java
+++ b/example/csv/src/test/java/org/apache/calcite/test/CsvTest.java
@@ -554,9 +554,9 @@ public class CsvTest {
 
       // Add some rows so that the table can deduce its row type.
       final Iterator<String> lines = Arrays.asList(strings).iterator();
-      worker.queue.put(writeLine(pw, lines.next())); // header
+      pw.println(lines.next()); // header
+      pw.flush();
       worker.queue.put(writeLine(pw, lines.next())); // first row
-      worker.queue.put(sleep(10));
       worker.queue.put(writeLine(pw, lines.next())); // second row
       final CalciteConnection calciteConnection =
           connection.unwrap(CalciteConnection.class);

Reply via email to