Commit 0fbec92
[GLUTEN-11550][UT] Add GlutenTestSetWithSystemPropertyTrait, enable 6 suites, remove 7 TestHiveSingleton suites, fix JobTagging flaky test (#11847)
* [GLUTEN-11550][UT] Add GlutenTestSetWithSystemPropertyTrait and enable 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>
* [GLUTEN-11550][UT] Remove TestHiveSingleton suites that cannot load GlutenPlugin
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>
* [GLUTEN-11550][UT] Fix JobTagging flaky test with fresh thread pool
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>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent ed93689 commit 0fbec92
30 files changed
Lines changed: 225 additions & 370 deletions
File tree
- gluten-ut
- common/src/test/scala/org/apache/spark/sql
- spark40/src/test/scala/org/apache
- gluten/utils/velox
- spark/sql
- execution
- sources
- spark41/src/test/scala/org/apache
- gluten/utils/velox
- spark/sql
- execution
- sources
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
Lines changed: 6 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
683 | | - | |
| 683 | + | |
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
699 | | - | |
| 699 | + | |
700 | 700 | | |
701 | | - | |
702 | | - | |
| 701 | + | |
| 702 | + | |
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
710 | | - | |
| 710 | + | |
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
| |||
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | 793 | | |
797 | | - | |
798 | | - | |
799 | | - | |
800 | | - | |
801 | 794 | | |
802 | 795 | | |
803 | 796 | | |
| |||
823 | 816 | | |
824 | 817 | | |
825 | 818 | | |
| 819 | + | |
826 | 820 | | |
827 | 821 | | |
828 | 822 | | |
| |||
Lines changed: 66 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
19 | 29 | | |
20 | 30 | | |
21 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 0 additions & 23 deletions
This file was deleted.
0 commit comments