apache / apache/hudi

Spark-SQL tests persist configs

Open
#15,639 1 comment 0 reactions 0 assignees View on GitHub
area:sql area:tests from-jira priority:medium status:pr-available
Dominant language
Java
Stars
6.2k
Forks
2.5k
Avg merge
2d 8h
Merged PRs (30d)
111

Description

Spark configs are persisted between tests. This can cause interaction between tests

## JIRA info

- Link: https://issues.apache.org/jira/browse/HUDI-5419
- Type: Test
- Attachment(s):
- 20/Dec/22 17:40;jonvex;logs_24157.zip;https://issues.apache.org/jira/secure/attachment/13054030/logs_24157.zip

---

## Comments

20/Dec/22 17:42;jonvex;[^logs_24157.zip] Are the logs for the last gh actions test run. In spark 3.1 file 6_UT - Common & Spark.txt you can see the output from the linked pull request. It seems like the tests may be running multithreaded but we're not sure. Going to stop work on this for now because the ROI is not high.;;;

---

20/Dec/22 17:44;jonvex;Here is my modified test function from HoodieSparkSqlTestBase incase something happens to the closed pr:
{code:java}
override protected def test(testName: String, testTags: Tag*)(testFun: => Any /* Assertion */)(implicit pos: source.Position): Unit = {
val conf = spark.sessionState.conf.getAllConfs
println(s"Before $testName")
for ((k, v) <- conf) {
println(s"k: $k, v: $v")
}
super.test(testName, testTags: _*)(
try {
testFun
} finally {
val catalog = spark.sessionState.catalog
catalog.listDatabases().foreach { db =>
catalog.listTables(db).foreach { table =>
catalog.dropTable(table, true, true)
}
}
println(s"After $testName")
for ((k, v) <- spark.sessionState.conf.getAllConfs) {
//some configs like spark.driver.port or spark.app.startTime may change
if (k.startsWith("hoodie")) {
if (!conf.contains(k)) {
println(s"unsetting k: $k, v: $v")
spark.sessionState.conf.unsetConf(k)
} else if (!conf(k).equals(v)) {
println(s"overwriting k: $k, v: $v with ${conf(k)}")
spark.sessionState.conf.setConfString(k, conf(k))
} else {
println(s"keeping k: $k, v: $v")
}
} else {
println(s"Doesn't start with hoodie k: $k, v: $v")
}
}
}
)
} {code};;;

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the test entry point in HoodieSparkSqlTestBase and review the Spark 3.1 output in the attached “6_UT - Common & Spark.txt” logs. Determine whether Spark SQL configurations persist or tests run concurrently, then verify that tests are isolated and no longer interact through shared configs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spark
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.