Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race condition in GtfsModuleTest #5357

Conversation

habrahamsson-skanetrafiken
Copy link
Contributor

This test is intermittently failing in our ci pipeline with error:

[ERROR]   GtfsModuleTest$Interlining.interline(List, int) » IllegalState stream has already been operated upon or closed

There is probably some kind of race condition. This PR fixes this by switching to using MethodSource.

@habrahamsson-skanetrafiken habrahamsson-skanetrafiken requested a review from a team as a code owner September 14, 2023 11:49
Arguments.of(List.of(bundle("A"), bundle("B"), bundle("C")), 6)
);
static Stream<Arguments> interliningCases() {
return Stream.of(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return Stream.of(
return List.of(

Probably ok without but safer if you switch to a List.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to check if it works with MethodSource

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would be ok with a stream but changed to List just to be sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MethodSource works with any collection.

@codecov
Copy link

codecov bot commented Sep 14, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.03% ⚠️

Comparison is base (d6fb013) 66.43% compared to head (45b459d) 66.41%.
Report is 1 commits behind head on dev-2.x.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5357      +/-   ##
=============================================
- Coverage      66.43%   66.41%   -0.03%     
+ Complexity     15210    15206       -4     
=============================================
  Files           1786     1786              
  Lines          69239    69239              
  Branches        7311     7311              
=============================================
- Hits           46001    45982      -19     
- Misses         20761    20782      +21     
+ Partials        2477     2475       -2     
Files Changed Coverage Δ
...pentripplanner/routing/api/request/StreetMode.java 95.55% <100.00%> (ø)

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leonardehrenfried leonardehrenfried added this to the 2.5 (next release) milestone Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants