diff --git a/tests/functional/agent/handler.go b/tests/functional/agent/handler.go index e59c9038b..9a2962604 100644 --- a/tests/functional/agent/handler.go +++ b/tests/functional/agent/handler.go @@ -665,6 +665,7 @@ func (srv *Server) handle_SIGQUIT_ETCD_AND_ARCHIVE_DATA() (*rpcpb.Response, erro } } + // TODO: Verify whether this cleaning of 'cache pages' is needed. srv.lg.Info("cleaning up page cache") if err := cleanPageCache(); err != nil { srv.lg.Warn("failed to clean up page cache", zap.String("error", err.Error())) diff --git a/tests/functional/agent/utils.go b/tests/functional/agent/utils.go index 45ea66333..d77fce60b 100644 --- a/tests/functional/agent/utils.go +++ b/tests/functional/agent/utils.go @@ -103,6 +103,6 @@ func copyFile(src, dst string) error { func cleanPageCache() error { // https://www.kernel.org/doc/Documentation/sysctl/vm.txt // https://github.com/torvalds/linux/blob/master/fs/drop_caches.c - cmd := exec.Command("/bin/sh", "-c", `echo "echo 1 > /proc/sys/vm/drop_caches" | sudo sh`) + cmd := exec.Command("/bin/sh", "-c", `echo "echo 1 > /proc/sys/vm/drop_caches" | sudo -s -n`) return cmd.Run() }