Make Docker test robust when removing a temp dir (#61639)
Closes #61614. Closes #61553. In a particular Docker test, ensure is shut down before removing the data directory. Also add the force flag to `rm`.
This commit is contained in:
parent
d94d6b5b70
commit
50119bb08f
|
@ -223,6 +223,10 @@ public class DockerTests extends PackagingTestCase {
|
|||
assertThat(nodes.at("/_nodes/successful").intValue(), equalTo(1));
|
||||
assertThat(nodes.at("/_nodes/failed").intValue(), equalTo(0));
|
||||
|
||||
// Ensure container is stopped before we remove tempEsDataDir, so nothing
|
||||
// is using the directory.
|
||||
removeContainer();
|
||||
|
||||
rmDirWithPrivilegeEscalation(tempEsDataDir);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -419,7 +419,7 @@ public class Docker {
|
|||
|
||||
args.add("cd " + containerBasePath.toAbsolutePath());
|
||||
args.add("&&");
|
||||
args.add("rm -r " + localPath.getFileName());
|
||||
args.add("rm -rf " + localPath.getFileName());
|
||||
final String command = String.join(" ", args);
|
||||
executePrivilegeEscalatedShellCmd(command, localPath, containerPath);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue