Skip to content

tables: use omero.repo.wait rather than SECONDS_SLEEP#5615

Merged
joshmoore merged 2 commits intoome:developfrom
joshmoore:tables-retry-2
Jan 17, 2018
Merged

tables: use omero.repo.wait rather than SECONDS_SLEEP#5615
joshmoore merged 2 commits intoome:developfrom
joshmoore:tables-retry-2

Conversation

@joshmoore
Copy link
Copy Markdown
Member

The previous loop checked for the elapsed time
to see whether waiting was necessary. The with-
wait method doesn't have access to the elapsed
time and so should run unconditionally.

Testing this PR

Testing is difficult since tables initialization needs to fail. If it fails, then several seconds should be waited. I tested locally by modifying https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroPy/test/unit/tablestest/test_servants.py#L27 and causing the method to fail.

Related reading

See #5593

The previous loop checked for the elapsed time
to see whether waiting was necessary. The with-
wait method doesn't have access to the elapsed
time and so should run unconditionally.
@joshmoore
Copy link
Copy Markdown
Member Author

Opening this because it should prevent training etc. from failing. However, omero.repo.wait is no longer being used which means this needs some cleaning/simplifying.

Having each method call _do_with_wait makes it difficult
to use the context of the loop. This re-simplifies the
individual methods in favor of a more explicit loop.
@joshmoore joshmoore changed the title tables: remove time.time clause tables: use omero.repo.wait rather than SECONDS_SLEEP Jan 16, 2018
@joshmoore joshmoore added this to the 5.4.2 milestone Jan 16, 2018
@rgozim
Copy link
Copy Markdown
Member

rgozim commented Jan 17, 2018

Works fine from running local tests.

@joshmoore joshmoore merged commit a352d21 into ome:develop Jan 17, 2018
@joshmoore joshmoore deleted the tables-retry-2 branch January 17, 2018 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants