Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2157)

Unified Diff: appengine/findit/waterfall/flake/recursive_flake_pipeline.py

Issue 2391063002: [Findit] Fix flaky tests due to importing pytz. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit/waterfall/flake/recursive_flake_pipeline.py
diff --git a/appengine/findit/waterfall/flake/recursive_flake_pipeline.py b/appengine/findit/waterfall/flake/recursive_flake_pipeline.py
index f3f423e1aaf5b1c6a7358a2039dbe8efd4c2043d..465eaeeec9d8642dfd8f15d4373862e7d82bb093 100644
--- a/appengine/findit/waterfall/flake/recursive_flake_pipeline.py
+++ b/appengine/findit/waterfall/flake/recursive_flake_pipeline.py
@@ -48,21 +48,21 @@ def _GetETAToStartAnalysis(manually_triggered):
# If the analysis is manually triggered, run it right away.
return time_util.GetUTCNow()
- now_at_mtv = time_util.GetDatetimeInTimezone(
+ now_at_pst = time_util.GetDatetimeInTimezone(
'US/Pacific', time_util.GetUTCNowWithTimezone())
- if now_at_mtv.weekday() >= 5: # PST Saturday or Sunday.
+ if now_at_pst.weekday() >= 5: # PST Saturday or Sunday.
return time_util.GetUTCNow()
- if now_at_mtv.hour < 11 or now_at_mtv.hour >= 18: # Before 11am or after 6pm.
+ if now_at_pst.hour < 11 or now_at_pst.hour >= 18: # Before 11am or after 6pm.
return time_util.GetUTCNow()
# Set ETA time to 6pm, and also with a random latency within 30 minutes to
# avoid sudden burst traffic to Swarming.
- diff = timedelta(hours=18 - now_at_mtv.hour,
- minutes=-now_at_mtv.minute,
- seconds=-now_at_mtv.second + random.randint(0, 30 * 60),
- microseconds=-now_at_mtv.microsecond)
- eta = now_at_mtv + diff
+ diff = timedelta(hours=18 - now_at_pst.hour,
+ minutes=-now_at_pst.minute,
+ seconds=-now_at_pst.second + random.randint(0, 30 * 60),
+ microseconds=-now_at_pst.microsecond)
+ eta = now_at_pst + diff
# Convert back to UTC.
return time_util.GetDatetimeInTimezone('UTC', eta)

Powered by Google App Engine
This is Rietveld 408576698