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:Capture output on fork test failures #3052

Merged
merged 1 commit into from
Aug 17, 2023
Merged

Test:Capture output on fork test failures #3052

merged 1 commit into from
Aug 17, 2023

Conversation

marcotc
Copy link
Member

@marcotc marcotc commented Aug 16, 2023

For the currently flaky Sidekiq test, https://app.circleci.com/pipelines/github/DataDog/dd-trace-rb/11471/workflows/136d17b9-9561-4937-b59c-66fb2dbadd0c/jobs/430307, the failure information is a rather generic Wait time exhausted! error.

I can make Sidekiq tests fail with Wait time exhausted! locally, by not having Redis running.

But this doesn't explain the CI failures because only a single Sidekiq test failes, while if Redis wasn't running virtually all of them would fail.
Also, the Redis containers' output in CircleCI's log looks nominal.

What this PR does

One thing that I notice lacking in the Sidekiq tests is any useful output during a failure.
This happens because tests executed in a forked process, and that fork's STDOUT and STDERR are not directly printed in the RSpec process.

This PR captures the forked process' outputs and prints them out when there's a test failure.

This should allow us to debug this Sidekiq issue better when it happens again in CircleCI.

This change should improving the debug of all forked test process, given it affect the shared test helper.

@marcotc marcotc requested a review from a team August 16, 2023 18:28
@github-actions github-actions bot added the dev/testing Involves testing processes (e.g. RSpec) label Aug 16, 2023
@marcotc marcotc self-assigned this Aug 16, 2023
@marcotc marcotc merged commit acc02c7 into master Aug 17, 2023
163 checks passed
@marcotc marcotc deleted the flaky-sidekiq branch August 17, 2023 17:37
@github-actions github-actions bot added this to the 1.14.0 milestone Aug 17, 2023
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.

3 participants