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 in execution of tests #6177

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,12 @@ void testPostProcessorWithMaxItinerariesFilterSetToOneArriveBy() {
@Nested
class FlexSearchWindow {

private static final Itinerary FLEX = newItinerary(A, T11_00)
private final Itinerary flex = newItinerary(A, T11_00)
.flex(T11_00, T11_30, B)
.withIsSearchWindowAware(false)
.build();
private static final Instant EARLIEST_DEPARTURE = FLEX.startTime().plusMinutes(10).toInstant();
private static final Duration SEARCH_WINDOW = Duration.ofHours(7);
private final Instant earliestDeparture = flex.startTime().plusMinutes(10).toInstant();
private final Duration searchWindow = Duration.ofHours(7);

/**
* When the filtering of direct flex by the transit search window is deactivated, the direct
Expand All @@ -320,18 +320,18 @@ class FlexSearchWindow {
void keepDirectFlexWhenFilteringByEarliestDepartureIsDisabled() {
ItineraryListFilterChain chain = createBuilder(true, false, 10)
.withFilterDirectFlexBySearchWindow(false)
.withSearchWindow(EARLIEST_DEPARTURE, SEARCH_WINDOW)
.withSearchWindow(earliestDeparture, searchWindow)
.build();
assertEquals(toStr(List.of(FLEX)), toStr(chain.filter(List.of(FLEX))));
assertEquals(toStr(List.of(flex)), toStr(chain.filter(List.of(flex))));
}

@Test
void removeDirectFlexWhenFilteringByEarliestDepartureIsEnabled() {
ItineraryListFilterChain chain = createBuilder(true, false, 10)
.withFilterDirectFlexBySearchWindow(true)
.withSearchWindow(EARLIEST_DEPARTURE, SEARCH_WINDOW)
.withSearchWindow(earliestDeparture, searchWindow)
.build();
assertEquals(toStr(List.of()), toStr(chain.filter(List.of(FLEX))));
assertEquals(toStr(List.of()), toStr(chain.filter(List.of(flex))));
}
}

Expand Down
Loading