GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-157161: Fix test_rollover_based_on_st_birthtime_only on slow machines by iamsharduld · Pull Request #157162 · python/cpython Conversation
|
| now = datetime.datetime.now() | ||
| GO_BACK = 5 # seconds | ||
| for secs in range(GO_BACK + 1): | ||
| go_back = int((now - start).total_seconds()) + 2 |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to include an inline comment on how this number is derived?
edit: or maybe rename s/go_back/total_time_spent (total_test_time, test_duration)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Good point, done. The window is now built in two named steps: test_duration from the measured elapsed time, then oldest = test_duration + 2, with a comment saying where the two seconds come from (the log file is created in setUp(), a moment before the test starts, and the suffix has a one second resolution).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| GO_BACK = 5 # seconds | ||
| for secs in range(GO_BACK + 1): | ||
| go_back = int((now - start).total_seconds()) + 2 | ||
| for secs in range(go_back + 1): |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Why add 2 on the line above, just to add 1 here?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
They were doing two different jobs, which is exactly why it read badly. The + 2 is the margin described above; the + 1 only makes range() cover oldest itself, since it is exclusive. The margin now has its own named variable and the loop carries an # inclusive of oldest comment, so neither number is bare arithmetic any more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Split the search window into the measured duration of the test and an explicit two second margin, and note that the range covers the oldest second as well.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! : please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Dropped the NEWS entry: this changes only tests, which the devguide lists among the exemptions. The same point was made on #157171 ("This is a fix to unreleased test. It does not need a NEWS entry") and on #157158, so I am applying it across my open test-only PRs rather than having it raised on each one. bedevere/news will stay red until (Edited to remove two user mentions that pinged core developers for no reason. Sorry for the noise.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.