Commit ab0db5f
committed
test(event): fix EventPluginLoader singleton pollution between tests
FilterQueryTest.testMatchFilter() sets filterQuery={fromBlock=100,
toBlock=190} on the EventPluginLoader singleton with no cleanup.
With forkEvery=100, tests sharing the same JVM inherit this stale
state, causing matchFilter() to return false for block 1 and
skipping processTrigger() entirely (0/293 instructions covered).
Add @after teardown in FilterQueryTest to reset filterQuery to null,
and add a defensive reset in BlockEventGetTest.@before as a guard
against any other preceding test leaving dirty singleton state.1 parent 12ab2c2 commit ab0db5f
2 files changed
Lines changed: 7 additions & 0 deletions
File tree
- framework/src/test/java/org/tron
- common/logsfilter
- core/event
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
0 commit comments