Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • S slapos.core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 38
    • Merge requests 38
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • slapos.core
  • Merge requests
  • !326

test/test_collect: fix some timezone dependent tests

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Jérome Perrin requested to merge fix/timezone_test_failure into master Aug 12, 2021
  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 1

This test was using time.strftime which uses the current machine timezone, but collection is done in UTC timezone, so the test was sometimes failing because the strftime('%Y-%m-%d') was another day than the same time in UTC time zone.

This test https://erp5js.nexedi.net/#/test_result_module/20210811-96D6B55F/8 for example had the problem. By using faketime and TZ=Europe/Paris environment variable, the same problems reproduced locally 100% of times.

The fix is to always use datetime.utcnow().strftime('%Y-%m-%d'), to not depend on the timezone.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix/timezone_test_failure
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7