tests/readlink.py
author Augie Fackler <augie@google.com>
Sun, 09 Oct 2016 04:25:22 -0400
changeset 30120 932faa29b4c1
parent 29485 6a98f9408a50
child 45830 c102b704edb5
permissions -rwxr-xr-x
test-clone: fix some instability in pooled clone race condition test Healthy output (one log file mentioning "existing pooled" and one mentioning "new pooled") will now print in a stable order, but unhealthy output will print some sort of error. This reduces the flakiness of the test from 55% to 38%. My next patch makes it completely stable.

#!/usr/bin/env python

from __future__ import absolute_import, print_function

import errno
import os
import sys

for f in sys.argv[1:]:
    try:
        print(f, '->', os.readlink(f))
    except OSError as err:
        if err.errno != errno.EINVAL:
            raise
        print(f, '->', f, 'not a symlink')

sys.exit(0)