Skip to content

Commit

Permalink
some moto logging (#641)
Browse files Browse the repository at this point in the history
Co-authored-by: Ray Bell <ray.bell@dtn.com>
  • Loading branch information
raybellwaves and Ray Bell committed Aug 25, 2022
1 parent 553f447 commit 32697ba
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion s3fs/tests/test_s3fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,27 @@ def s3_base():
os.environ["AWS_SECRET_ACCESS_KEY"] = "foo"
if "AWS_ACCESS_KEY_ID" not in os.environ:
os.environ["AWS_ACCESS_KEY_ID"] = "foo"
proc = subprocess.Popen(shlex.split("moto_server s3 -p %s" % port))
proc = subprocess.Popen(
shlex.split("moto_server s3 -p %s" % port),
stderr=subprocess.DEVNULL,
stdout=subprocess.DEVNULL,
stdin=subprocess.DEVNULL,
)

timeout = 5
while timeout > 0:
try:
print("polling for moto server")
r = requests.get(endpoint_uri)
if r.ok:
break
except:
pass
timeout -= 0.1
time.sleep(0.1)
print("server up")
yield
print("moto done")
proc.terminate()
proc.wait()

Expand Down

0 comments on commit 32697ba

Please sign in to comment.