GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove all sleep() statements from unit tests · Issue #2220 · googleapis/google-cloud-python

Remove all sleep() statements from unit tests #2220

New issue
Copy link
New issue
Copy link
Closed
Closed
Remove all sleep() statements from unit tests#2220
Copy link
Assignees
lukesneeringer
Labels
api: loggingIssues related to the Cloud Logging API.priority: p2Moderately-important priority. Fix may not be included in next release.testing

Description

@dhermes
dhermes
opened on Aug 30, 2016
Issue body actions

Without the sleeps, the unit tests are "fast", i.e. they just run without any pauses and take ~1.5 seconds. With the sleeps from the three offending test cases, the unit tests take ~4.5 seconds.

@waprin these are all in gcloud.logging.handlers.transport.test_background_thread. Wanted to assign this to you but can't for some reason? (Never sure how org. vs. project permissions matter for issue assignment.)

Activity

  1. dhermes
    added
    testing
    hygiene
    api: loggingIssues related to the Cloud Logging API.
    on Aug 30, 2016
  2. tseaver commented on Feb 7, 2017

    @tseaver
    tseaver
    on Feb 7, 2017
    Contributor
    More actions

    Another option is to shorten the sleeps drastically (e.g., time.sleep(0.05) vs. time.sleep(1).

  3. dhermes commented on Feb 7, 2017

    @dhermes
    dhermes
    on Feb 7, 2017
    ContributorAuthor
    More actions

    @tseaver In a perfect world we'd just have a check which says "really human? you want your unit tests to be non-deterministic?". In other words, the "simple check" just disallows all sleeps and doesn't differentiate / allow for nuance (this is more scalable across all devs).

  4. lukesneeringer
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 19, 2017
  5. lukesneeringer commented on Aug 11, 2017

    @lukesneeringer
    lukesneeringer
    on Aug 11, 2017
    Contributor
    More actions

    Confirmed that sleep no longer appears in this file. I also verified the three places it does appear in our unit tests and ensured it was mocked.

  6. lukesneeringer
    closed this as completedon Aug 11, 2017
  7. JustinBeckwith
    assigned
    lukesneeringer
    on Feb 1, 2021
  8. parthea
    added a commit that references this issue on Nov 24, 2025

    chore: update templated files (#2220)

    ee5a318
  9. parthea
    added a commit that references this issue on Mar 6, 2026

    chore(deps): bump urllib3 from 2.4.0 to 2.5.0 in /samples/geography (#…

    e81aee2
  10. parthea
    added 2 commits that reference this issue on Apr 1, 2026

    feat: support left_index and right_index for merge (#2220)

    6007895

    chore(main): release 2.29.0 (#2242)

    a69afc4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @lukesneeringer
    lukesneeringer

Labels

api: loggingIssues related to the Cloud Logging API.priority: p2Moderately-important priority. Fix may not be included in next release.testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.