Skip to content

Use process substitution to redirect to tee#46431

Merged
thaJeztah merged 1 commit intomoby:masterfrom
rumpl:fix-ci-timeout
Sep 8, 2023
Merged

Use process substitution to redirect to tee#46431
thaJeztah merged 1 commit intomoby:masterfrom
rumpl:fix-ci-timeout

Conversation

@rumpl
Copy link
Member

@rumpl rumpl commented Sep 8, 2023

- What I did

In some cases, when the daemon launched by a test panics and quits, the cleanup code would end with an error when trying to kill it by its pid. In those cases the whole suite will end up waiting for the daemon that we start in .integration-daemon-start to finish and we end up waiting 2 hours for the CI to cancel after a timeout.

Using process substitution makes the integration tests quit.

- How I did it

- How to verify it

Run

$ make DOCKER_GRAPHDRIVER=overlayfs TEST_FILTER=TestRunWithRuntimeFromConfigFile TEST_INTEGRATION_USE_SNAPSHOTTER=1 test-integration

Before this change this will never stop and hang after the /go/src/github.com/docker/docker/hack/make/.integration-daemon-stop: line 11: kill: (1269) - No such process error.

After this change the script will stop after the kill error in the cleanup code.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

)
bundle .integration-daemon-stop
) 2>&1 | tee -a "$DEST/test.log"
) 2>&1 >(tee -a "$DEST/test.log")
Copy link
Contributor

Choose a reason for hiding this comment

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

no &>? Are the changes in these two file different because we don't want to redirect stderr here?

Copy link
Member Author

Choose a reason for hiding this comment

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

It was a mistake, fixed it, thanks

In some cases, when the daemon launched by a test panics and quits, the
cleanup code would end with an error when trying to kill it by its pid.
In those cases the whole suite will end up waiting for the daemon that
we start in .integration-daemon-start to finish and we end up waiting 2
hours for the CI to cancel after a timeout.

Using process substitution makes the integration tests quit.

Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Copy link
Contributor

@sam-thibault sam-thibault left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

So much black magic!

As discussed; this is fixing the issue we ran into, so I'm good with merging this.

But let me also /cc @albers and @tianon (on leave), just in case they have better suggestions for a follow up ❤️

@rumpl
Copy link
Member Author

rumpl commented Sep 8, 2023

@vvoland just updated his PR #45232 and added this commit, we can now even see if this works

Copy link
Member

@akerouanton akerouanton left a comment

Choose a reason for hiding this comment

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

Oh I think I ran into this a few times while running integration tests through delve. I guess I'll now be able to submit my change. Thanks for tackling this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants