Skip to content

Commit 2b2f1ee

Browse files
authored
Merge pull request #2261 from broadinstitute/jb-test-stability-fix
Updating tests for stability
2 parents a42dab6 + 4659b1b commit 2b2f1ee

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

bin/run_orch_smoke_test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ DOCKER_IMAGE_NAME="gcr.io/broad-singlecellportal-staging/single-cell-portal"
1818
DOCKER_IMAGE_VERSION="development"
1919
PASSENGER_APP_ENV="test"
2020
NON_DOCKERIZED="false"
21+
# disable warnings about frozen literals
22+
export RUBYOPT=--disable-frozen-string-literal
2123

2224
while getopts "k:e:v:d" OPTION; do
2325
case $OPTION in

test/integration/external/study_validation_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ class StudyValidationTest < ActionDispatch::IntegrationTest
130130
end
131131
puts "After #{seconds_slept} seconds, " + (example_files.values.map { |e| "#{e[:name]} is #{e[:object].parse_status}"}).join(", ") + '.'
132132

133-
study.reload
134-
135133
example_files.values.each do |e|
136134
e[:object].reload # address potential race condition between parse_status setting to 'failed' and DeleteQueueJob executing
137135
assert_equal 'failed', e[:object].parse_status, "Incorrect parse_status for #{e[:name]}"
@@ -140,6 +138,8 @@ class StudyValidationTest < ActionDispatch::IntegrationTest
140138
assert cached_file.present?, "Did not find cached file at #{e[:cache_location]} in #{study.bucket_id}"
141139
end
142140

141+
sleep(5)
142+
study.reload
143143
assert_equal 0, study.cell_metadata.size
144144
assert_equal 0, study.genes.size
145145
assert_equal 0, study.cluster_groups.size

test/lib/summary_stats_utils_test.rb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,21 @@ class SummaryStatsUtilsTest < ActiveSupport::TestCase
157157
end
158158

159159
test 'should get data retention policy report' do
160+
expected_studies = Study.where(detached: false, firecloud_project: FireCloudClient::PORTAL_NAMESPACE)
160161
client_mock = Minitest::Mock.new
161162
bucket_mock = Minitest::Mock.new
162-
created_at = DateTime.now.in_time_zone - 1.day
163-
bucket_mock.expect :nil?, false
164163
file_mock = Minitest::Mock.new
165-
2.times do
166-
bucket_mock.expect :next?, false
167-
file_mock.expect :next?, false
164+
created_at = DateTime.now.in_time_zone - 1.day
165+
expected_studies.each do |study|
166+
bucket_mock.expect :nil?, false
167+
2.times do
168+
bucket_mock.expect :next?, false
169+
file_mock.expect :next?, false
170+
end
171+
file_mock.expect :any?, true
172+
bucket_mock.expect :files, file_mock
173+
client_mock.expect :get_workspace_bucket, bucket_mock, [study.bucket_id]
168174
end
169-
file_mock.expect :any?, true
170-
bucket_mock.expect :files, file_mock
171-
client_mock.expect :get_workspace_bucket, bucket_mock, [String]
172175
FireCloudClient.stub :new, client_mock do
173176
SummaryStatsUtils.stub :bytes_and_last_created_for,
174177
[250.gigabytes, created_at],

0 commit comments

Comments
 (0)