[GLUTEN-11550][UT] Add GlutenTestSetWithSystemPropertyTrait, enable 6 suites, remove 7 TestHiveSingleton suites, fix JobTagging flaky test#11847
Merged
baibaichen merged 3 commits intoapache:mainfrom Apr 10, 2026
Conversation
|
Run Gluten Clickhouse CI on x86 |
619c5dd to
6662b97
Compare
|
Run Gluten Clickhouse CI on x86 |
6662b97 to
b303883
Compare
|
Run Gluten Clickhouse CI on x86 |
b600264 to
4987bcb
Compare
|
Run Gluten Clickhouse CI on x86 |
4987bcb to
e9e760f
Compare
|
Run Gluten Clickhouse CI on x86 |
…e 6 suites Add a reusable trait for test suites whose parent creates per-test SparkContext/SparkSession (via LocalSparkContext/LocalSparkSession). It injects GlutenPlugin config via system properties so per-test sessions inherit it, avoiding shared session conflicts. Enable 6 suites by switching to this trait: - GlutenSQLExecutionSuite (SQLExecutionSuite: new SparkContext internally) - GlutenSQLJsonProtocolSuite (SQLJsonProtocolSuite with LocalSparkSession) - GlutenShufflePartitionsUtilSuite (ShufflePartitionsUtilSuite with LocalSparkContext) - GlutenExternalAppendOnlyUnsafeRowArraySuite (with LocalSparkContext) - GlutenUnsafeRowSerializerSuite (UnsafeRowSerializerSuite with LocalSparkSession) - GlutenSparkSessionJobTaggingAndCancellationSuite (with LocalSparkContext) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…lutenPlugin Remove 7 test suites (spark40 + spark41) that extend TestHiveSingleton. TestHiveSingleton.spark (protected val) conflicts with Gluten test traits' spark (implicit protected def), making it impossible to load GlutenPlugin. The non-Hive variants (e.g. GlutenBucketedReadWithoutHiveSupportSuite) are already enabled and cover the same functionality. Removed suites: - GlutenBucketedReadWithHiveSupportSuite - GlutenBucketedWriteWithHiveSupportSuite - GlutenDisableUnnecessaryBucketedScanWithHiveSupportSuite - GlutenCommitFailureTestRelationSuite - GlutenJsonHadoopFsRelationSuite - GlutenParquetHadoopFsRelationSuite - GlutenSimpleTextHadoopFsRelationSuite Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The original test uses ExecutionContext.global whose ForkJoinPool reuses threads created long before addTag(). InheritableThreadLocal (used by managedJobTags) only copies values at thread creation time, so reused threads see an empty tag map. This causes withSessionTagsApplied to not attach the user tag to the job, making cancelJobsWithTagWithFuture return empty. Fix: testGluten override that creates a fresh SingleThreadExecutor AFTER addTag(), ensuring the new thread inherits InheritableThreadLocal values. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e9e760f to
f75e867
Compare
|
Run Gluten Clickhouse CI on x86 |
zhli1142015
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
1. Add
GlutenTestSetWithSystemPropertyTrait— a reusable trait for test suites whose Spark parent creates per-test SparkContext/SparkSession (viaLocalSparkContext,LocalSparkSession, or directnew SparkContext). It injects GlutenPlugin config via system properties so per-test sessions inherit it.2. Enable 6 suites by switching to this trait:
GlutenSQLExecutionSuiteGlutenSQLJsonProtocolSuiteGlutenShufflePartitionsUtilSuiteGlutenExternalAppendOnlyUnsafeRowArraySuiteGlutenUnsafeRowSerializerSuiteGlutenSparkSessionJobTaggingAndCancellationSuite3. Remove 7 TestHiveSingleton suites that cannot load GlutenPlugin due to trait conflict (
TestHiveSingleton.spark(protected val) vs Gluten traitspark(implicit protected def)). The non-Hive variants are already enabled. Updatedexcluded-spark-uts.md.4. Fix JobTagging flaky test — The original
"Tags set from session are prefixed with session UUID"test usesExecutionContext.globalwhose ForkJoinPool reuses threads created beforeaddTag().InheritableThreadLocal(used bymanagedJobTags) only copies values at thread creation time, so reused threads see an empty tag map. This causeswithSessionTagsAppliedto not attach the user tag to the job, makingcancelJobsWithTagWithFuturereturn empty.Root cause confirmed via CI debug logging: Future thread (id=17689) had
managedJobTags=Map()while main thread had the correct tag. The fix creates a freshSingleThreadExecutorafteraddTag()so the new thread inheritsInheritableThreadLocalvalues.How was this patch tested?
run-scala-test.shRelated issue: #11550