scriptotek / alma-slipsomat

Tool for syncing Alma letters XSL files with a local folder
MIT License
15 stars 10 forks source link

push: timeout kicks in early. (sandbox takes forever) #33

Closed th122 closed 6 years ago

th122 commented 6 years ago

The Sandbox is extremely slow. Slipsomat has long since given up when the sandbox eventually returns from saving the first file. The file does get saved successfully, leaving the checksums invalid.

A push cycle therefore goes like this (for every file changed)

...
- header.xsl (19/02/2018)                                      saving...                               
Exception: Message: 

Traceback (most recent call last):
  File "/Volumes/Users/theuser/.pyenv/versions/3.6.4/lib/python3.6/site-packages/slipsomat-0.1.0-py3.6.egg/slipsomat/slipsomat.py", line 1079, in execute
    function(self.browser, *args)
  File "/Volumes/Users/theuser/.pyenv/versions/3.6.4/lib/python3.6/site-packages/slipsomat-0.1.0-py3.6.egg/slipsomat/slipsomat.py", line 805, in push
    if letter.push():
  File "/Volumes/Users/theuser/.pyenv/versions/3.6.4/lib/python3.6/site-packages/slipsomat-0.1.0-py3.6.egg/slipsomat/slipsomat.py", line 692, in push
    EC.presence_of_element_located((By.CSS_SELECTOR, ".typeD table"))
  File "/Volumes/Users/theuser/.pyenv/versions/3.6.4/lib/python3.6/site-packages/selenium-3.9.0-py3.6.egg/selenium/webdriver/support/wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 

[?] Now what?: Exit
   Restart browser
   Debug with ipdb
   Debug with pdb
 > Exit
danmichaelo commented 6 years ago

Goodness, is it often that slow?

Could increase the timeout a bit though. It's 10 seconds now. Perhaps 20 or even 30 seconds would be better?

daniels commented 6 years ago

Maybe you could add a setting for it?

th122 commented 6 years ago

It often is that slow, molasses or tar is a rapid flow in comparison ;). Increasing the timeout might help some, but by now that would be hard to see because ...

My problems by now seem to be two different ones with the same error message though: a) at first an update of files would (if all went well/hopefully) continue to the list of letters, and barf with a timeout while saving the first letter to be updated - in that case it was possible to wait until the letter was actually stored (and wait, and wait...) and then get slipsomat back in sync by pulling the stored letter to update the checksum, and continue with the next letter (same procedure). That's in the past now, though, and another problem kicks in before it even manages to pass to the list of letters b) Some of those timeout problems seem to have come up with the may release, though - since that was introduced, I have to manually switch to the correct menu to have upload or test function at all (using english UI). I've changed my workflow to not update more than one or (keeping my fingers crossed) two templates at once, and things are proceeding of sorts.

It's still a dramatic improvement compared to the intended workflow as designed by ExLibris... :)

daniels commented 6 years ago

It looks like your new problem is the one I noticed in #34, that the script can no longer find the General link and would timeout regardless how long the timeout threshold is. If you apply that fix does the problem persist?

danmichaelo commented 6 years ago

So I changed the default timeout from 10 to 20 seconds, and made the timeout 40 seconds when uploading a file. Also added a default_timeout option to the slipsomat.cfg file

th122 commented 6 years ago

thanks, that timeout did solve the problem for me. Fortunately at the moment it's also faster again, so it seems ExLibris adressed their side.