You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently writing smashbox based functional tests for our locking backend.
My first try was to sync and it is hanging infinite until 2.1 (to be released), due to the cmd retrying infinite times: owncloud/client#4037
Now I wrote a new method that sets a timeout:
try:
run_ocsync_timeout(d, seconds=10)
exceptTimeoutErroraserr:
# FIXME Issue raised https://github.com/owncloud/client/issues/4037logger.warning(err.message)
[...]
# TODO move the block below into cernboxclassTimeoutError(Exception):
passdefhandler(signum, frame):
raiseTimeoutError('Sync client did not terminate in time')
defrun_ocsync_timeout(local_folder, remote_folder="", n=None, user_num=None, seconds=None):
ifsecondsisnotNone:
signal.signal(signal.SIGALRM, handler)
signal.alarm(seconds)
# This run_ocsync() may hang indefinitelyrun_ocsync(local_folder, remote_folder, n, user_num)
ifsecondsisnotNone:
signal.alarm(0)
Now my questions:
Do you think it makes sense to add the timeout option to the default sync command?
For new client versions --max-sync-retries support would be very nice to have. Can we add that to run_ocsync as well or should this be part of oc_sync_cmd? We can check if the client supports it by looking at --help:
cmd=config.oc_sync_cmdifmax_sync_retriesisnotNone:
help_cmd=cmdifhelp_cmd[0-len(' --trust'):] ==' --trust':
help_cmd=help_cmd[:0-len(' --trust')]
returncode, stdout, stderr=runcmd(help_cmd+' --help', ignore_exitcode=True)
try:
ifstdout.index('--max-sync-retries') isnotNone:
cmd+=' --max-sync-retries %i'%max_sync_retriesexceptValueError:
logger.warning('max-sync-retries ignored, because the client does not support it')
I'm currently writing smashbox based functional tests for our locking backend.
My first try was to sync and it is hanging infinite until 2.1 (to be released), due to the cmd retrying infinite times: owncloud/client#4037
Now I wrote a new method that sets a timeout:
Now my questions:
--max-sync-retries
support would be very nice to have. Can we add that torun_ocsync
as well or should this be part ofoc_sync_cmd
? We can check if the client supports it by looking at--help
:@moscicki
The text was updated successfully, but these errors were encountered: