Repository navigation
Make RunContexts more consistent - #1846
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1846 +/- ##
============================================
- Coverage 80.33% 80.33% -0.01%
- Complexity 4239 4242 +3
============================================
Files 434 434
Lines 13285 13300 +15
Branches 1688 1692 +4
============================================
+ Hits 10672 10684 +12
- Misses 1974 1976 +2
- Partials 639 640 +1 ☔ View full report in Codecov by Sentry. |
| if (!runContexts.contains(this)) { | ||
| // something weird happened, and we got the got a separate RunContext hierarchy from what we'd expect | ||
| // maybe some thread re-use between runs | ||
| runContexts.clear(); | ||
| runContexts.add(this); | ||
| } else { |
There was a problem hiding this comment.
This seams a bit too much to always asks for contains, which will traverse the whole linked list, and after that we traverse again. Isn't there a better way to do that?
Or maybe this is premature opt from my side, because are there many RunContexts anyway?
There was a problem hiding this comment.
I think in the wild it is 99.9% just one context.
And for Spock it is 99.0% 1 and 1% with 2.
And it should be the first element if nothing has gone wrong.
I've added an early return if everything is as it should be.
|
I'm hoping that this will fix errors like this https://scans.gradle.com/s/yhbiiuhgxklaa/tests/task/:spock-specs:test/details/org.spockframework.runtime.RunContextSpec?top-execution=1 |
No description provided.