Skip to content
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

IDLE: Fix tooltip Hovertiptest failure #79952

Closed
terryjreedy opened this issue Jan 18, 2019 · 9 comments
Closed

IDLE: Fix tooltip Hovertiptest failure #79952

terryjreedy opened this issue Jan 18, 2019 · 9 comments
Assignees
Labels
3.7 only security fixes 3.8 only security fixes 3.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@terryjreedy
Copy link
Member

BPO 35771
Nosy @terryjreedy, @taleinat, @ZackerySpytz, @miss-islington
PRs
  • bpo-35771: Increase the hover_delay in IDLE's test_tooltip #14926
  • bpo-35771: IDLE: Fix and optimize flaky tool-tip hover delay tests #15634
  • [3.7] bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634) #15657
  • [3.8] bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634) #15658
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2019-09-03.05:45:33.779>
    created_at = <Date 2019-01-18.06:51:07.371>
    labels = ['3.8', 'expert-IDLE', 'type-bug', '3.7', '3.9']
    title = 'IDLE: Fix tooltip Hovertiptest failure'
    updated_at = <Date 2019-09-03.05:45:33.778>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2019-09-03.05:45:33.778>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2019-09-03.05:45:33.779>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2019-01-18.06:51:07.371>
    creator = 'terry.reedy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35771
    keywords = ['patch']
    message_count = 9.0
    messages = ['333946', '334064', '348364', '348374', '348976', '351060', '351062', '351063', '351064']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'taleinat', 'ZackerySpytz', 'miss-islington']
    pr_nums = ['14926', '15634', '15657', '15658']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue35771'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @terryjreedy
    Copy link
    Member Author

    In the buildbot testing for bpo-35730, this test failed on X86 Windows 3.7 and passed on retest. I did not check the green bots, so there could be other fail and pass results.

    ======================================================================
    FAIL: test_showtip_on_mouse_enter_hover_delay (idlelib.idle_test.test_tooltip.HovertipTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "D:\cygwin\home\db3l\buildarea\3.7.bolen-windows7\build\lib\idlelib\idle_test\test_tooltip.py", line 112, in test_showtip_on_mouse_enter_hover_delay
        self.assertFalse(tooltip.tipwindow and tooltip.tipwindow.winfo_viewable())
    AssertionError: 1 is not false

    We should at least look at this since it might someday fail twice in a row on 1 machine.

    @terryjreedy terryjreedy added 3.7 only security fixes 3.8 only security fixes type-bug An unexpected behavior, bug, or error labels Jan 18, 2019
    @taleinat
    Copy link
    Contributor

    This is due to the test using a 50ms delay on hover, and checking "immediately" after generating an "<Enter>" event that it hasn't triggered yet. Note that this isn't actually "immediately": The Tk root's update() is called in between to simulate having a live Tk event loop.

    On slow machines this could indeed fail due to the update() call taking a while.

    I originally chose 50ms since it seemed like more than enough. Using a longer delay would make the test more robust, but would make testing unnecessarily slow on fast machines.

    Perhaps we should look for a more general solution, such as multiplying all test time values by a scale factor depending on a machine's execution speed? That would avoid such future errors in many tests, while keeping the tests faster on fast machines.

    Otherwise let's just increase this to 100ms or 200ms.

    @terryjreedy terryjreedy self-assigned this Mar 20, 2019
    @2776f601-9573-4690-ab86-59139fdf3c89
    Copy link
    Mannequin

    ZackerySpytz mannequin commented Jul 24, 2019

    For what it's worth, I see this failure often when running the test suite. I have created a pull request to increase the delay.

    @2776f601-9573-4690-ab86-59139fdf3c89 ZackerySpytz mannequin added the 3.9 only security fixes label Jul 24, 2019
    @terryjreedy
    Copy link
    Member Author

    I had forgotten about this, but by coincidence, it occurred again today, on 'x86 Windows7 3.7' after PR-14919 was merged. This may be the same machine as I might have left '7' off 'Windows' in the original report.

    The 'windows timer' is used for time.sleep. From various web articles, I read that its resolution varies from 10 to 25, defaults to 15.8 milleseconds in Win7 (this is the figure I knew years ago), and defaults to 35 microseconds in Win 10. (Not exactly agreement.) time.sleep is hardly accurate for small fractions of a second delays, and delays may be much longer. I believe that root.after does better.

    Zachery, what OS and version do you have?

    @2776f601-9573-4690-ab86-59139fdf3c89
    Copy link
    Mannequin

    ZackerySpytz mannequin commented Aug 4, 2019

    Sorry for the delay. I'm using Lubuntu 19.04.

    @terryjreedy
    Copy link
    Member Author

    New changeset 132acab by Terry Jan Reedy (Tal Einat) in branch 'master':
    bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634)
    132acab

    @terryjreedy
    Copy link
    Member Author

    To decide whether I agree that a live delay test is needed would take time and energy currently better applied to other issues. Since the 2nd PR reduces net test time, and should be at least as good in avoiding spurious failures, I am merging it now. If I later take a new, more general look at when live tests are needed, that will be another issue.

    @miss-islington
    Copy link
    Contributor

    New changeset 4805805 by Miss Islington (bot) in branch '3.7':
    bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634)
    4805805

    @miss-islington
    Copy link
    Contributor

    New changeset 1c18aec by Miss Islington (bot) in branch '3.8':
    bpo-35771: IDLE: Fix flaky tool-tip hover delay tests (GH-15634)
    1c18aec

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 only security fixes 3.8 only security fixes 3.9 only security fixes topic-IDLE type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants