16314: Fix cleanup of temp/arvbox dirs that contain readonly dirs.
[arvados.git] / build / run-tests.sh
index 2742540b16b44efe57fa113d23d3e967915e5c2f..c926fe87a17f0a740e2913e63d5464c12f6554f9 100755 (executable)
@@ -162,9 +162,12 @@ temp_preserve=
 
 clear_temp() {
     if [[ -z "$temp" ]]; then
-        # we didn't even get as far as making a temp dir
+        # we did not even get as far as making a temp dir
         :
     elif [[ -z "$temp_preserve" ]]; then
+        # Go creates readonly dirs in the module cache, which cause
+        # "rm -rf" to fail unless we chmod first.
+        chmod -R u+w "$temp"
         rm -rf "$temp"
     else
         echo "Leaving behind temp dirs in $temp"