New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 807506 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature



Sign in to add a comment

Provide time.sleep() in the time recipe module

Project Member Reported by mknyszek@google.com, Jan 31 2018

Issue description

We've recently found a use-case (polling inside of a recipe) for which having sleep() be available in the time recipe module would be useful.

Polling inside of a recipe isn't good, and inserting sleep calls  isn't good either, but it but for now it's a reasonable solution until we figure out the appropriate place to poll (FWIW, we're polling gerrit from our auto-roller).

Testing without a mockable sleep is hard, since you have to pass potentially small numbers to sleep hoping it won't impact testing.
 
Owner: iannucci@chromium.org
Status: Assigned (was: Untriaged)
From my PoV, reasonable given current recipe engine.

To iannucci@ to decide if it's good or bad.
Owner: mknyszek@google.com
Project Member

Comment 4 by bugdroid1@chromium.org, Feb 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/luci/recipes-py/+/8f09f5f2571c4ec5b22269eb44e53742dfae29fb

commit 8f09f5f2571c4ec5b22269eb44e53742dfae29fb
Author: Michael Anthony Knyszek <mknyszek@google.com>
Date: Tue Feb 06 01:01:11 2018

Add sleep to the time recipe module

This change adds a testable 'sleep' method to the time recipe module.

Bug:  807506 
Change-Id: Iffd9b1cd97c3836b7aef83cf5fc9b213e26ca80f
Reviewed-on: https://chromium-review.googlesource.com/894691
Commit-Queue: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>

[modify] https://crrev.com/8f09f5f2571c4ec5b22269eb44e53742dfae29fb/recipe_modules/time/api.py
[modify] https://crrev.com/8f09f5f2571c4ec5b22269eb44e53742dfae29fb/README.recipes.md
[modify] https://crrev.com/8f09f5f2571c4ec5b22269eb44e53742dfae29fb/recipe_modules/time/examples/full.py

Comment 5 by mknyszek@google.com, Apr 27 2018

Status: Fixed (was: Assigned)
This was fixed by my change some time ago. Closing...

Sign in to add a comment