-
Notifications
You must be signed in to change notification settings - Fork 19
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
When a TIMED OUT occur we do not clean the go-build* folder in /tmp #182
Comments
This is almost the same as #177, and both the solution proposed are analogous. Maybe it is worth to implement them together. What do you think? Is GOTMPDIR used only by tests? |
@k3rn31 Actually yes we can implement both in the same PR.
if you only export the GOCACHE go test still creates go-build dirs in the /tmp folder. So changing the GOTMPDIR will move those folders in whatever dir we choose. I did a quick test from the terminal: export GOCACHE=/tmp/gremlins
./dist/bin/gremlins unleash . When we have a timed_out we still have go-build folder in /tmp. Using export GOTMPDIR=/tmp/gremlins
./dist/bin/gremlins unleash . If we go under /tmp/gremlins we can find the go-build dirs there. |
@k3rn31 You can find my idea here: https://github.com/alessio-perugini/gremlins/pull/3/files |
@alessio-perugini I did, more or less, the same experiment yesterday with the same result, everything KILLED... I don't know why 😄 |
@k3rn31 using func (m *mutantExecutor) Start(w *workerpool.Worker) {
defer m.wg.Done()
workerName := fmt.Sprintf("%s-%d", w.Name, w.ID)
rootDir, err := m.wdDealer.Get(workerName)
if err != nil {
panic("error, this is temporary")
}
os.Setenv("GOTMPDIR", filepath.Dir(rootDir))
... |
I believe you have to execute cmd.Env = os.Environ() before setting the GOTMPDIR variable, otherwise you will lose the current env (only GOTMPDIR will be present). cmd.Env = os.Environ()
cmd.Env = append(cmd.Env, m.goTmpDirEnv) |
@k3rn31 How I couldn't think about that! Your suggestion is working flawlessly 🤩 |
When we call the
go test
it first builds all the files needed to run the tests. The build artifacts are created under /tmp dir by default and have a name likego-build19625282
.Every time we kill the execution of
go test
it does not clean the build directory created under the /tmp dir. This means that every time we have a mutation that goes on TIMED_OUT we do not clear the relative build dirs.Step I did to reproduce:
Solution
Set the
GOTMPDIR
env var that will be used bygo test
to store all the build dirs of gremlins. Clean up that folder before quittinggremlins
.The text was updated successfully, but these errors were encountered: