Skip to content
Closed
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
4 changes: 4 additions & 0 deletions R/pkg/inst/tests/testthat/test_streaming.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ test_that("read.stream, write.stream, awaitTermination, stopQuery", {
q <- write.stream(counts, "memory", queryName = "people", outputMode = "complete")

expect_false(awaitTermination(q, 5 * 1000))
callJMethod(q@ssq, "processAllAvailable")
expect_equal(head(sql("SELECT count(*) FROM people"))[[1]], 3)

writeLines(mockLinesNa, jsonPathNa)
awaitTermination(q, 5 * 1000)
callJMethod(q@ssq, "processAllAvailable")
expect_equal(head(sql("SELECT count(*) FROM people"))[[1]], 6)

stopQuery(q)
Expand All @@ -75,6 +77,7 @@ test_that("print from explain, lastProgress, status, isActive", {
q <- write.stream(counts, "memory", queryName = "people2", outputMode = "complete")

awaitTermination(q, 5 * 1000)
callJMethod(q@ssq, "processAllAvailable")

expect_equal(capture.output(explain(q))[[1]], "== Physical Plan ==")
expect_true(any(grepl("\"description\" : \"MemorySink\"", capture.output(lastProgress(q)))))
Expand All @@ -99,6 +102,7 @@ test_that("Stream other format", {
q <- write.stream(counts, "memory", queryName = "people3", outputMode = "complete")

expect_false(awaitTermination(q, 5 * 1000))
callJMethod(q@ssq, "processAllAvailable")
expect_equal(head(sql("SELECT count(*) FROM people3"))[[1]], 3)

expect_equal(queryName(q), "people3")
Expand Down