py: intermittent error in cache test, can't find .lock file

Description

Saw this error running unit test suite (test_caching.py). Re-ran and tests passed several times.

The failure happened on slow wireless connection which may have helped expose a concurrency bug.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest self.test(*self.arg) File "/Users/chris/Documents/work/projects/pythonClient/tests/integration/test_caching.py", line 109, in test_threaded_access collect_errors_and_fail() File "/Users/chris/Documents/work/projects/pythonClient/tests/integration/test_caching.py", line 140, in collect_errors_and_fail raise SynapseError('\n' + '\n'.join(failures)) SynapseError: Traceback (most recent call last): File "/Users/chris/Documents/work/projects/pythonClient/tests/integration/test_caching.py", line 124, in child_thread function() File "/Users/chris/Documents/work/projects/pythonClient/tests/integration/test_caching.py", line 185, in thread_get_and_update_file_from_Project entity = syn.get(id) File "/Users/chris/Documents/work/projects/pythonClient/synapseclient/client.py", line 529, in get return self._getWithEntityBundle(entity, entityBundle=self._getEntityBundle(entity, version), **kwargs) File "/Users/chris/Documents/work/projects/pythonClient/synapseclient/client.py", line 584, in _getWithEntityBundle downloadFile = cache.local_file_has_changed(bundle, True, downloadPath) File "/Users/chris/Documents/work/projects/pythonClient/synapseclient/cache.py", line 81, in local_file_has_changed for file, cacheTime, cachedFileMTime in iterator_over_cache_map(cacheDir): File "/Users/chris/Documents/work/projects/pythonClient/synapseclient/cache.py", line 315, in iterator_over_cache_map cache = obtain_lock_and_read_cache(cacheDir) File "/Users/chris/Documents/work/projects/pythonClient/synapseclient/cache.py", line 245, in obtain_lock_and_read_cache os.utime(cacheLock, (0, time.time())) OSError: [Errno 2] No such file or directory: '/Users/chris/.synapseCache/881/182881/.lock'

Environment

None

Status

Assignee

Kimyen Truong

Reporter

Chris Bare

Labels

Validator

Xavier Schildwachter

Release Version History

None

Components

Fix versions

Priority

Minor
Configure