Commit 590ad09
committed
[refactor] Rename task types in test files to avoid schema cache pollution
Root Cause: Test pollution from shared static schema cache.
The Task class has a static _inputSchemaNode: Map<string, SchemaNode> that caches compiled schemas keyed by the task's type property. Two different test files defined task classes with the same static type values ("TaskA", "TaskB") but with different schemas:
GraphAsTask.test.ts: TaskB expects inputB: { type: "string" }
IteratorTask.test.ts: TaskB expects required: ["result"]
When tests run in a different order on CI vs locally, the static cache from one test would pollute the other:
IteratorTask.test.ts runs first and caches a schema for "TaskB" that requires result
GraphAsTask.test.ts runs later and uses that cached schema, causing the validation error
Fix: Added unique prefixes to the type names to avoid cache collisions:
GraphAsTask.test.ts: "GraphAsTask_TaskA", "GraphAsTask_TaskB", "GraphAsTask_TaskC"
IteratorTask.test.ts: "IteratorTask_TaskA", "IteratorTask_TaskB"1 parent 714a4b6 commit 590ad09
2 files changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1436 | 1436 | | |
1437 | 1437 | | |
1438 | 1438 | | |
1439 | | - | |
| 1439 | + | |
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
| |||
1457 | 1457 | | |
1458 | 1458 | | |
1459 | 1459 | | |
1460 | | - | |
| 1460 | + | |
1461 | 1461 | | |
1462 | 1462 | | |
1463 | 1463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | | - | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
81 | 83 | | |
82 | 84 | | |
83 | 85 | | |
84 | | - | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
0 commit comments