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

gh-116622: Mock the passage of time in Android logcat rate limit tests#124015

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
freakboy3742 merged 2 commits intopython:mainfrommhsmith:android-rate-limit
Sep 13, 2024

Conversation

mhsmith
Copy link
Member

@mhsmithmhsmith commentedSep 12, 2024
edited by bedevere-appbot
Loading

The emulator on the buildbot is apparently subject to wild swings in performance, so the only way to make this test reliable is to take the test machine's real clock out of the equation.

@@ -78,6 +79,7 @@ def assert_log(self, level, tag, expected, *, skip=False, timeout=0.5):
def tearDown(self):
self.logcat_process.terminate()
self.logcat_process.wait(LOOPBACK_TIMEOUT)
self.logcat_thread.join(LOOPBACK_TIMEOUT)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This fixes an unrelated warning I saw while running the tests repeatedly with-F:

Warning -- threading._dangling was modified by test_androidWarning --   Before: {<weakref at 0x7c15b68e00; to 'threading._MainThread' at 0x7c18f5fcb0>}Warning --   After:  {<weakref at 0x7c186e3ce0; to 'threading._MainThread' at 0x7c18f5fcb0>, <weakref at 0x7c1870ef20; to 'threading.Thread' at 0x7c183faa50>}

@@ -369,6 +371,8 @@ def write(b, lines=None, *, write_len=None):
):
stream.write(obj)


class TestAndroidRateLimit(unittest.TestCase):
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This test doesn't read its own output, so it doesn't need the@skipIf or thesetUp from the other class.

Copy link
Contributor

@freakboy3742freakboy3742 left a comment

Choose a reason for hiding this comment

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

👍

@freakboy3742freakboy3742enabled auto-merge (squash)September 13, 2024 04:56
@freakboy3742freakboy3742 merged commitf554883 intopython:mainSep 13, 2024
32 checks passed
@miss-islington-app
Copy link

Thanks@mhsmith for the PR, and@freakboy3742 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 13, 2024
…t tests (pythonGH-124015)Mock the passage of time in Android logcat rate limit tests(cherry picked from commitf554883)Co-authored-by: Malcolm Smith <smith@chaquo.com>Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
@bedevere-app
Copy link

GH-124035 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelSep 13, 2024
Yhg1s pushed a commit that referenced this pull requestSep 30, 2024
…it tests (GH-124015) (#124035)gh-116622: Mock the passage of time in Android logcat rate limit tests (GH-124015)Mock the passage of time in Android logcat rate limit tests(cherry picked from commitf554883)Co-authored-by: Malcolm Smith <smith@chaquo.com>Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@freakboy3742freakboy3742freakboy3742 approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@mhsmith@freakboy3742

[8]ページ先頭

©2009-2025 Movatter.jp