summaryrefslogtreecommitdiff
path: root/spec/factories/issues.rb
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-09-12 15:11:49 +0200
committerPaco Guzman <pacoguzmanp@gmail.com>2016-09-12 15:44:41 +0200
commitb7814205dc3aed8e1f405c43a63e376fec726112 (patch)
treeb99638d81b366c4925c4b606a83a95f0db50874b /spec/factories/issues.rb
parent45afdbef0de58f6de207b057e47151611d2ad7e6 (diff)
downloadgitlab-ce-b7814205dc3aed8e1f405c43a63e376fec726112.tar.gz
Ensure specs on sorting of issues in API are deterministic on MySQL22057-fix-api-ossues-sorting-flaky-specs
MySQL could not have support for millisecond precision, depends on the MySQL version so we just create issues in different seconds in a deterministic way
Diffstat (limited to 'spec/factories/issues.rb')
-rw-r--r--spec/factories/issues.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/factories/issues.rb b/spec/factories/issues.rb
index 2c0a2dd94ca..2b4670be468 100644
--- a/spec/factories/issues.rb
+++ b/spec/factories/issues.rb
@@ -1,4 +1,8 @@
FactoryGirl.define do
+ sequence :issue_created_at do |n|
+ 4.hours.ago + ( 2 * n ).seconds
+ end
+
factory :issue do
title
author