diff --git a/cmd/nonmem.go b/cmd/nonmem.go index 72735caf..1a857f34 100644 --- a/cmd/nonmem.go +++ b/cmd/nonmem.go @@ -512,6 +512,13 @@ func filesToCleanup(model *NonMemModel, exceptions ...string) runner.FileCleanIn } } } + + re_wk := regexp.MustCompile("^WK_[0-9]+") + for _, f := range files { + if f.Size() == 0 && !f.IsDir() && re_wk.MatchString(f.Name()) { + fci.FilesToRemove = append(fci.FilesToRemove, newTargetFile(f.Name(), model.Configuration.CleanLvl)) + } + } } return fci diff --git a/integration/nonmem.go b/integration/nonmem.go index 411fa5ac..cd9b8cb3 100644 --- a/integration/nonmem.go +++ b/integration/nonmem.go @@ -60,6 +60,13 @@ func AssertNonMemCleanedUpFiles(t *wrapt.T, details NonMemTestingDetails) { t.A.NoFileExists(filepath.Join(details.OutputDir, f)) } } + + // Parallelization-related files handled by nonmem.filesToCleanup(). + files, err := os.ReadDir(details.OutputDir) + t.R.NoError(err) + for _, fi := range files { + t.R.NotRegexp("^WK_", fi.Name()) + } } func AssertBBIConfigJSONCreated(t *wrapt.T, details NonMemTestingDetails) {