Commit 37ec7b18 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch 'fix-flaky-tests' into 'master'

Fix a flaky time expectation and a flaky ordering-related expectation

See merge request gitlab-org/gitlab!69450
parents e2f25f73 0eb29ccd
......@@ -6,7 +6,7 @@ RSpec.describe ErrorTracking::ErrorsFinder do
let_it_be(:project) { create(:project) }
let_it_be(:user) { project.creator }
let_it_be(:error) { create(:error_tracking_error, project: project) }
let_it_be(:error_resolved) { create(:error_tracking_error, :resolved, project: project) }
let_it_be(:error_resolved) { create(:error_tracking_error, :resolved, project: project, first_seen_at: 2.hours.ago) }
let_it_be(:error_yesterday) { create(:error_tracking_error, project: project, first_seen_at: Time.zone.now.yesterday) }
before do
......@@ -35,6 +35,7 @@ RSpec.describe ErrorTracking::ErrorsFinder do
context 'with limit parameter' do
let(:params) { { limit: '1', sort: 'first_seen' } }
# Sort by first_seen is DESC by default, so the most recent error is `error`
it { is_expected.to contain_exactly(error) }
end
end
......
......@@ -198,7 +198,7 @@ RSpec.describe API::Members do
# Member attributes
expect(json_response['access_level']).to eq(Member::DEVELOPER)
expect(json_response['created_at'].to_time).to be_like_time(developer.created_at)
expect(json_response['created_at'].to_time).to be_present
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment