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

x/build: detect leftover temporary files? #9806

Open
minux opened this issue Feb 8, 2015 · 6 comments

Comments

@minux
Copy link
Member

commented Feb 8, 2015

Could the builders detect that there isn't any leftover temporary
files in $TMPDIR after testing each repo? (We need to whitelist
a few, for example gopath-api-*)

Ideally this should be treated a build failure and reported back
to the CL that triggered this.

Each time I logged into the netbsd-386 builder, I find a lot
temporary files in /tmp. However, as I don't know which build
generated them, I have to manually check if the bug is still
there.

@minux minux added the repo-build label Feb 8, 2015
@bradfitz

This comment has been minimized.

Copy link
Member

commented Feb 8, 2015

Yes, we could do something like this. Maybe we add a new flag to the buildlet exec handler like "?detect-tmp-leak=1" and if so, it scans tmp before & after the run, and only complains if the command exited with success and any files in $TMPDIR (or equivalent) are new from the beginning of the run.

/cc @adg

@minux

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2015

@bradfitz

This comment has been minimized.

Copy link
Member

commented Feb 8, 2015

SGTM

@minux

This comment has been minimized.

Copy link
Member Author

commented Feb 8, 2015

@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc changed the title builder: detect leftover temporary files? x/build: detect leftover temporary files? Apr 14, 2015
@rsc rsc removed the repo-build label Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc added the Builders label Jun 11, 2015
@bradfitz

This comment has been minimized.

Copy link
Member

commented Sep 4, 2019

As of https://go-review.googlesource.com/c/144637 (for #27182 and #28041) we at least now set TMPDIR to $WORKDIR/tmp (a fresh directory per run).

So we could make the coordinator scan that directory after each dist test run so we fail as quickly as possible and figure out which dist test was responsible.

@bradfitz

This comment has been minimized.

Copy link
Member

commented Sep 4, 2019

@toothrot, this might be a good warm-up coordinator job. It should just involve adding to:

func (st *buildStatus) runTestsOnBuildlet(bc *buildlet.Client, tis []*testItem, goroot, gopath string) {

Somewhere after it runs a test successfully, then run buildlet.Client's list files method on $WORKDIR/tmp and make sure it's empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.