import argparse
import atexit
import errno
+import glob
import httplib2
import os
import pipes
import shutil
import signal
import socket
-import subprocess
import string
+import subprocess
import sys
import tempfile
import time
raise
os.mkfifo(fifo, 0700)
subprocess.Popen(
- ['sed', '-e', 's/^/['+label+'] /', fifo],
+ ['stdbuf', '-i0', '-oL', '-eL', 'sed', '-e', 's/^/['+label+'] /', fifo],
stdout=sys.stderr)
return fifo
"""
global my_api_host
- # Delete cached discovery document.
- shutil.rmtree(arvados.http_cache('discovery'))
+ # Delete cached discovery documents.
+ #
+ # This will clear cached docs that belong to other processes (like
+ # concurrent test suites) even if they're still running. They should
+ # be able to tolerate that.
+ for fn in glob.glob(os.path.join(arvados.http_cache('discovery'),
+ '*,arvados,v1,rest,*')):
+ os.unlink(fn)
pid_file = _pidfile('api')
pid_file_ok = find_server_pid(pid_file, 0)