Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test:Fix sucker_punch flaky test #1148

Merged
merged 1 commit into from
Aug 20, 2020
Merged

test:Fix sucker_punch flaky test #1148

merged 1 commit into from
Aug 20, 2020

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Aug 18, 2020

Fixes https://app.circleci.com/pipelines/github/DataDog/dd-trace-rb/1691/workflows/ebaf9777-0229-49e2-9172-438841cea5d4/jobs/81378:

  1) sucker_punch instrumentation delayed job should instrument enqueuing for a delayed job
     Failure/Error: is_expected.to be true
     
       expected true
            got false
     # ./spec/ddtrace/contrib/sucker_punch/patcher_spec.rb:118:in `block in <main>'
     # ./spec/ddtrace/contrib/sucker_punch/patcher_spec.rb:23:in `block in <main>'

This error happens because SuckerPunch::Job#perform_in schedules the job to be performed and then checks if the job status is :pending right before returning. If the job finishes too quickly, it might have already been moved into a :fulfilled, thus making #perform_in return false.

This PR does not verify the return value of #perform_in anymore, as it is unimportant to our tests, but maintains the verification that the job has finished and that the correct spans have been generated.

@marcotc marcotc added the dev/testing Involves testing processes (e.g. RSpec) label Aug 18, 2020
@marcotc marcotc added this to the 0.40.0 milestone Aug 18, 2020
@marcotc marcotc requested a review from a team August 18, 2020 21:22
@marcotc marcotc self-assigned this Aug 18, 2020
Copy link
Contributor

@ericmustin ericmustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@marcotc marcotc merged commit e761a4e into master Aug 20, 2020
@marcotc marcotc deleted the test/fix-flaky-sucker branch August 20, 2020 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/testing Involves testing processes (e.g. RSpec)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants