coursemology2
coursemology2 copied to clipboard
Fix flaky CircleCI tests
Flaky tests:
Course::Duplication::CourseDuplicationService with tenant :instance #duplicate_course when survey question options has attachments duplicates the attachment references but not the attachments
Failure/Error:
create(:survey_question, :multiple_choice, section: survey.sections.first,
option_traits: [:with_attachment])
ActiveRecord::NotNullViolation:
PG::NotNullViolation: ERROR: null value in column "attachment_id" violates not-null constraint
DETAIL: Failing row contains (6dbedebf-f804-4a19-8091-7e60b0e5d377, 2, Course::Survey::QuestionOption, null, text.txt, null, 1, 1, 2021-10-04 01:15:24.094205, 2021-10-04 01:15:24.094205).
./spec/services/course/duplication/course_duplication_service_spec.rb:459:in `block (5 levels) in <top (required)>'
./spec/support/bullet.rb:8:in `block in extended'
------------------
--- Caused by: ---
PG::NotNullViolation:
ERROR: null value in column "attachment_id" violates not-null constraint
DETAIL: Failing row contains (6dbedebf-f804-4a19-8091-7e60b0e5d377, 2, Course::Survey::QuestionOption, null, text.txt, null, 1, 1, 2021-10-04 01:15:24.094205, 2021-10-04 01:15:24.094205).
./spec/services/course/duplication/course_duplication_service_spec.rb:459:in `block (5 levels) in <top (required)>'
Course::Duplication::CourseDuplicationService with tenant :instance #duplicate_course when survey question options has attachments duplicates the question options
Failure/Error:
create(:survey_question, :multiple_choice, section: survey.sections.first,
option_traits: [:with_attachment])
ActiveRecord::NotNullViolation:
PG::NotNullViolation: ERROR: null value in column "attachment_id" violates not-null constraint
DETAIL: Failing row contains (a1a7ec90-991d-4428-af73-305d0b3baec2, 4, Course::Survey::QuestionOption, null, text.txt, null, 1, 1, 2021-10-04 01:15:24.380616, 2021-10-04 01:15:24.380616).
./spec/services/course/duplication/course_duplication_service_spec.rb:459:in `block (5 levels) in <top (required)>'
./spec/support/bullet.rb:8:in `block in extended'
------------------
--- Caused by: ---
PG::NotNullViolation:
ERROR: null value in column "attachment_id" violates not-null constraint
DETAIL: Failing row contains (a1a7ec90-991d-4428-af73-305d0b3baec2, 4, Course::Survey::QuestionOption, null, text.txt, null, 1, 1, 2021-10-04 01:15:24.380616, 2021-10-04 01:15:24.380616).
./spec/services/course/duplication/course_duplication_service_spec.rb:459:in `block (5 levels) in <top (required)>'