Skip to content

Commit

Permalink
[KYUUBI #2287] Revamp Flink IT by random port and merge tests
Browse files Browse the repository at this point in the history
### _Why are the changes needed?_

Flink IT shall use random-available port for kyuubi server
we shall merge ITs to prevent creating duplicated servers and engines

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #2287 from yaooqinn/flink.

Closes #2287

a0acce2 [Kent Yao] Revamp Flink IT by random port and merge tests
ad5ae0f [Kent Yao] Revamp Flink IT by random port and merge tests

Authored-by: Kent Yao <yao@apache.org>
Signed-off-by: Kent Yao <yao@apache.org>
  • Loading branch information
yaooqinn committed Apr 7, 2022
1 parent c4a608f commit 19f1d41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 50 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
package org.apache.kyuubi.it.flink.operation

import org.apache.kyuubi.config.KyuubiConf
import org.apache.kyuubi.config.KyuubiConf.{ENGINE_TYPE, FRONTEND_THRIFT_BINARY_BIND_PORT}
import org.apache.kyuubi.config.KyuubiConf.ENGINE_TYPE
import org.apache.kyuubi.it.flink.WithKyuubiServerAndFlinkMiniCluster
import org.apache.kyuubi.operation.HiveJDBCTestHelper
import org.apache.kyuubi.operation.meta.ResultSetSchemaConstant.TABLE_CAT

class FlinkOperationSuite extends WithKyuubiServerAndFlinkMiniCluster with HiveJDBCTestHelper {
override val conf: KyuubiConf = KyuubiConf()
.set(ENGINE_TYPE, "FLINK_SQL")
.set(FRONTEND_THRIFT_BINARY_BIND_PORT, 10019)
.set("flink.parallelism.default", "6")

override protected def jdbcUrl: String = getJdbcUrl

Expand All @@ -50,4 +50,20 @@ class FlinkOperationSuite extends WithKyuubiServerAndFlinkMiniCluster with HiveJ
assert(resultSet.getString(1) === "tmp.hello")
}
}

test("set kyuubi conf into flink conf") {
withJdbcStatement() { statement =>
val resultSet = statement.executeQuery("SET")
// Flink does not support set key without value currently,
// thus read all rows to find the desired one
var success = false
while (resultSet.next() && !success) {
if (resultSet.getString(1) == "parallelism.default" &&
resultSet.getString(2) == "6") {
success = true
}
}
assert(success)
}
}
}

0 comments on commit 19f1d41

Please sign in to comment.