-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Calculate fake import start from import end #5060
Conversation
939bb59
to
df81462
Compare
524d59b
to
d217275
Compare
I suspect that for this test to have failed, it needed to start at something like |
@@ -162,10 +162,10 @@ public function testGetRunTimeSeconds() | |||
|
|||
$this->assertSame(0, $import->getRunTimeSeconds()); | |||
|
|||
$this->fakeImportStartDate($import, 600); | |||
|
|||
$import->end(false); |
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.
Put a small delay before here in the original code, e.g.:
usleep(100000);
and then run the test and you get about 10% fails.
With just the natural compute time delay it is a bit difficult to get the "random" fail.
8f29554
to
047e5e4
Compare
047e5e4
to
f2f4fe5
Compare
Rebased |
2eb0dc2
to
8371db6
Compare
Rebased on top of #5367 so that CI should pass. |
8371db6
to
dfbfaa4
Compare
Rebased again |
Works for me, even after 1000 runs of test, nothing brakes (I had usleep(100000); added) |
Description:
Calculate
fakeImportStartDate()
as an offset from the end date-time, rather than the current date-time. That should avoid rounding issues due to the real time delay between setting end date-time and then making the adjustment to fake the start date-time.Fix a bunch of comment typos in
Import.php
while we are here.Steps to reproduce the bug:
Steps to test this PR: