Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MockResponse total_time should not be simulated when provided#40239

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:4.4fromManoManoTech:fix-mock-response-total-time
Feb 26, 2021
Merged

MockResponse total_time should not be simulated when provided#40239

nicolas-grekas merged 1 commit intosymfony:4.4fromManoManoTech:fix-mock-response-total-time
Feb 26, 2021

Conversation

@pvgnd
Copy link
Contributor

@pvgndpvgnd commentedFeb 18, 2021
edited
Loading

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

When you provide atotal_time to a MockResponse, it is overriden. It should be simulated only when it is not provided I guess.
Ex:new MockResponse('{"foo":"bar"}', ['total_time' => 0.4])

javespi reacted with thumbs up emoji
@pvgndpvgnd changed the base branch from5.x to5.2February 18, 2021 14:06
@nicolas-grekasnicolas-grekas changed the titlefix: MockResponse total_time should not be simulated when provided[HttpClient] MockResponse total_time should not be simulated when providedFeb 18, 2021
@carsonbot
Copy link

Hey!

Two days ago, I was sitting at my usual spot at the top of Big Ben, I was thinking that we really needed this. And now, here you are with a PR. =)

I think@javespi has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

Copy link
Contributor

@javespijavespi left a comment

Choose a reason for hiding this comment

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

It makes sense to me 👍

Comment on lines -311 to 292

if (isset($response->info['total_time'])) {
if (!isset($response->info['total_time'])) {
$response->info['total_time'] =microtime(true) -$response->info['start_time'];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

To measure the time that passes between the two calls.

javespi reacted with thumbs up emoji
@carsonbotcarsonbot changed the title[HttpClient] MockResponse total_time should not be simulated when providedMockResponse total_time should not be simulated when providedFeb 21, 2021
@nicolas-grekasnicolas-grekas added this to the5.2 milestoneFeb 22, 2021
@nicolas-grekas
Copy link
Member

This should target 4.4, since the bug exists there, isn't it?
Can you please rebase, and maybe add a test case?

@pvgndpvgnd changed the base branch from5.2 to4.4February 25, 2021 17:59
@pvgnd
Copy link
ContributorAuthor

This should target 4.4, since the bug exists there, isn't it?
Can you please rebase, and maybe add a test case?

Done

@nicolas-grekasnicolas-grekas modified the milestones:5.2,4.4Feb 25, 2021
@nicolas-grekas
Copy link
Member

Thank you@pvgnd.

@nicolas-grekasnicolas-grekas merged commita5683c5 intosymfony:4.4Feb 26, 2021
This was referencedMar 4, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@javespijavespijavespi approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

5 participants

@pvgnd@carsonbot@nicolas-grekas@javespi@chalasr

[8]ページ先頭

©2009-2025 Movatter.jp