This test fails: mistral.tests.unit.services.test_trigger_service.TriggerServiceV2Test.test_trigger_create

Bug #1654218 reported by Dougal Matthews
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
Fix Released
Medium
Brad P. Crochet

Bug Description

The following test passes in CI, but fails locally for me (and a few other people that I asked to try). It can be tested with:

tox -e py27 mistral.tests.unit.services.test_trigger_service.TriggerServiceV2Test.test_trigger_create

Dougal Matthews (d0ugal)
Changed in mistral:
importance: Undecided → Medium
status: New → Confirmed
assignee: nobody → Dougal Matthews (d0ugal)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to mistral (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/416938

Dougal Matthews (d0ugal)
Changed in mistral:
assignee: Dougal Matthews (d0ugal) → nobody
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on mistral (master)

Change abandoned by Dougal Matthews (<email address hidden>) on branch: master
Review: https://review.openstack.org/416938

Revision history for this message
Brad P. Crochet (brad-9) wrote :

This seems to be introduced by https://review.openstack.org/#/c/406740/ (to fix bug https://bugs.launchpad.net/mistral/+bug/1592164)

There may be some new bugs lurking in there. For one thing, the get_next_execution_time should not be messing around with UTC. All croniter does is update a given time based on a pattern. If you then do the utc conversion, there is potential that it will actual double the error, i.e. time being off by 8 instead of just 4 hours.

Changed in mistral:
milestone: none → pike-1
assignee: nobody → Brad P. Crochet (brad-9)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (master)

Reviewed: https://review.openstack.org/441082
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=101f3ea5241344723ace39d38c43f3a7f2b6cd7f
Submitter: Jenkins
Branch: master

commit 101f3ea5241344723ace39d38c43f3a7f2b6cd7f
Author: Brad P. Crochet <email address hidden>
Date: Thu Mar 2 12:53:45 2017 -0500

    Use utcnow() in expired executions policy test

    This test fails if the TZ of the execution environment is not UTC. Using
    utcnow() ensures that the tested values are the same as what comes from
    the DB. The DB stores timestamps in UTC.

    Change-Id: I70af0d8009b5fa35777961ed3189a80ddcee28b1
    Partial-Bug: #1654218

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/441083
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=f005100d16c09154a0c6f328b1fcba0d9734c13d
Submitter: Jenkins
Branch: master

commit f005100d16c09154a0c6f328b1fcba0d9734c13d
Author: Brad P. Crochet <email address hidden>
Date: Fri Mar 3 06:59:01 2017 -0500

    Fix get_next_execution_time

    get_next_execution_time was incorrectly modifying it's return value
    based on a conversion from localtime to UTC. However, this function
    should not be doing such a conversion. It could result in multiplying
    a TZ error. Croniter doesn't care about TZ. It just applies a pattern
    to a given start time; therefore, it should be up to the caller to
    pass the proper time.

    Also, start_time is now based on utcnow() instead of localtime now().

    Change-Id: Ifbd63d9e1f56085928bede22ce4f2954e1b38991
    Partial-Bug: #1654218

Changed in mistral:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-mistralclient (master)

Reviewed: https://review.openstack.org/441350
Committed: https://git.openstack.org/cgit/openstack/python-mistralclient/commit/?id=d1508e0991f965763a9a044b6174f4a74ace443a
Submitter: Jenkins
Branch: master

commit d1508e0991f965763a9a044b6174f4a74ace443a
Author: Brad P. Crochet <email address hidden>
Date: Fri Mar 3 14:12:36 2017 -0500

    Add --utc flag to cron trigger create

    The server should not be doing any translation of times. It should be
    assumed that what is sent to the server is being sent as UTC. The
    addition of the --utc flags facilitates this. If the --utc flag is
    specified, then the --first-time passed is assumed to be already
    UTC and will not undergo a conversion. If it is not passed, the
    --first-time arg will be converted based on the the localtime of the
    client, then sent as UTC.

    Change-Id: I424d042d1cbdadae3aa14cd408d9f27d14823aef
    Depends-On: Ifbd63d9e1f56085928bede22ce4f2954e1b38991
    Closes-Bug: #1654218

Changed in mistral:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-mistralclient 3.1.0

This issue was fixed in the openstack/python-mistralclient 3.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.