-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Change Queue on to Deque in InMemoryRequestJournalStore #2299
Conversation
@tomakehurst @oleg-nenashev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would definitely more confident about such a change if we had some performance test to prove impact when recording the journal and in the getter. My gut feeling is that it is a positive improvement, so I am +1 for trying it out in the beta
@tomakehurst @oleg-nenashev |
src/main/java/com/github/tomakehurst/wiremock/stubbing/ServeEvent.java
Outdated
Show resolved
Hide resolved
@@ -407,7 +406,7 @@ public void doesNotDuplicateCookieHeaders() { | |||
testClient.get("/duplicate/cookies", withHeader("Cookie", "session=1234")); | |||
|
|||
LoggedRequest lastRequest = | |||
getLast(target.find(getRequestedFor(urlEqualTo("/duplicate/cookies")))); | |||
getFirst(target.find(getRequestedFor(urlEqualTo("/duplicate/cookies"))), null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will be a breaking change for a lot of folks. How about we modify AbstractRequestJournal.getRequestsMatching(...) to reverse the results so that they'll come back in the same order as previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomakehurst
But we will return to what we left...
Breaking changes it's normal when update version IMHO...
And as a user, I'm waiting in "history" for more recent entries to be at the top...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean reverse the result of the find query rather than the whole list, which would have a pretty trivial impact by comparison and only affect finding vs. fetching the whole journal.
Agree it's in principle acceptable to create breaking changes, but this one is avoidable and my instinct is that it'll annoy people.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomakehurst
Something like that:
List<LoggedRequest> loggedRequests = getRequests().filter(thatMatch(requestPattern, customMatchers)).collect(toList());
Collections.reverse(loggedRequests);
return loggedRequests;
?
Thanks! |
Change Queue on to Deque in InMemoryRequestJournalStore and ServeEvent
#2296
Submitter checklist