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

chore(api): further speed up ot3controller tests and add profiling #12132

Merged
merged 4 commits into from
Feb 10, 2023

Commits on Feb 10, 2023

  1. chore(api): add pytest-profiling

    pytest-profiling ( https://pypi.org/project/pytest-profiling/ ) is a
    pytest module that will automatically profile your tests for you if you
    so wish. If you add --profile to your test command, it will dump out
    top-ten calls by time, and it will dump more in-depth profiling data to
    `prof/` which can be interpreted with the python stdlib pstats/ module.
    sfoster1 committed Feb 10, 2023
    Configuration menu
    Copy the full SHA
    9e2d4b7 View commit details
    Browse the repository at this point in the history
  2. chore(api): patch out ot3 gpio sleep

    The OT3 gpio drivers have a sleep(1) in their init method. This isn't
    great, and will soon be removed - it was required for some nasty
    interactions between estop initialization and our canbus driver when it
    was initializing, and on later revs we don't need to handle the estop
    line like this - but in the meantime we can patch it out.
    
    This makes these tests take about a second in total instead of 80 seconds.
    sfoster1 committed Feb 10, 2023
    Configuration menu
    Copy the full SHA
    2832ba7 View commit details
    Browse the repository at this point in the history
  3. chore(api): use 0-sleeps to spin asyncio loops

    In the cleanup of the thread manager, we were doing an
    asyncio.sleep(0.1) to spin the loop to make sure some classes cleaned
    up. Since then, we've learned that a 0-second sleep does the same thing.
    Changing the 0.1 to 0 should not present any changes in behavior (and if
    it does, they're in a cleanup method that is basically never run in
    prod) and doubles the speed of the tests in hardware_control.
    sfoster1 committed Feb 10, 2023
    Configuration menu
    Copy the full SHA
    0226b4d View commit details
    Browse the repository at this point in the history
  4. chore(api): poll much faster for module server

    We start and stop a lot of module servers, and polling to see whether
    they're started should be a lot faster now.
    sfoster1 committed Feb 10, 2023
    Configuration menu
    Copy the full SHA
    637116d View commit details
    Browse the repository at this point in the history