Failed: Timed out waiting for pyramid file 2741_pyramid
Stack Trace
self = <test.integration.test_thumbs.TestThumbs object at 0x7f44efbef150>
meth = 'set'
@pytest.mark.parametrize("meth", ("one", "set",))
def testThumbnailVersion(self, meth):
assert meth in ("one", "set")
i64 = rint(64)
pix = self.missing_pyramid()
q = ("select tb from Thumbnail tb "
"where tb.pixels.id = %s "
"order by tb.id desc ")
q = q % pix
p = ParametersI().page(0, 1)
def get():
return self.query.findByQuery(q, p)
# Before anything has been called, there
# should be no thumbnail
assert not get()
# At this stage, there should still be no
# thumbnail
tb = self.client.sf.createThumbnailStore()
if meth == "one":
tb.setPixelsId(int(pix))
tb.resetDefaults()
assert not tb.thumbnailExists(i64, i64)
assert tb.isInProgress()
# As soon as it's requested, it should have a -1
# version to mark pyramid creation as ongoing.
if meth == "one":
before = tb.getThumbnail(i64, i64)
assert not tb.thumbnailExists(i64, i64)
assert tb.isInProgress()
elif meth == "set":
before = tb.getThumbnailSet(i64, i64, [int(pix)])
before = before[int(pix)]
assert get().version.val == -1
# Now we wait until the pyramid has been created
# and test that a proper version has been set.
event = get_event("test_thumbs")
secs = 20
rps = self.client.sf.createRawPixelsStore()
for x in range(secs):
try:
rps.setPixelsId(int(pix), True)
event = None
break
except MissingPyramidException:
event.wait(1)
if event:
assert "Pyramid was not generated %ss" % secs
if meth == "one":
# Re-load the thumbnail store now that
# the pyramid is generated.
tb.close()
tb = self.client.sf.createThumbnailStore()
# Wait for pyramid gen - slower on NFS
# and needs a check via FS.
self.wait_for_pyramid_file(pix)
if not tb.setPixelsId(int(pix)):
tb.resetDefaults()
tb.close()
tb = self.client.sf.createThumbnailStore()
assert tb.setPixelsId(int(pix))
after = tb.getThumbnail(i64, i64)
assert before != after
assert tb.thumbnailExists(i64, i64)
assert not tb.isInProgress()
elif meth == "set":
> self.wait_for_pyramid_file(pix)
test/integration/test_thumbs.py:183:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <test.integration.test_thumbs.TestThumbs object at 0x7f44efbef150>
pixels_id = '2741', timeout = 120
def wait_for_pyramid_file(self, pixels_id, timeout=120):
pixels_dir = (
"/home/omero/workspace/"
"OMERO-test-integration/data/Pixels"
)
expected = f"{pixels_id}_pyramid"
deadline = time.time() + timeout
while time.time() < deadline:
for root, _, files in os.walk(pixels_dir):
if expected in files:
return
time.sleep(1)
> pytest.fail(
f"Timed out waiting for pyramid file {expected}"
)
E Failed: Timed out waiting for pyramid file 2741_pyramid
test/integration/test_thumbs.py:105: Failed