<caseResult _class='hudson.tasks.junit.CaseResult'><age>13</age><className>OmeroPy.test.integration.test_thumbs.TestThumbs</className><duration>148.922</duration><errorDetails>Failed: Timed out waiting for pyramid file 2741_pyramid</errorDetails><errorStackTrace>self = &lt;test.integration.test_thumbs.TestThumbs object at 0x7ff0f4f7e110&gt;
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":
&gt;           self.wait_for_pyramid_file(pix)

test/integration/test_thumbs.py:183: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = &lt;test.integration.test_thumbs.TestThumbs object at 0x7ff0f4f7e110&gt;
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() &lt; deadline:
            for root, _, files in os.walk(pixels_dir):
                if expected in files:
                    return
            time.sleep(1)
    
&gt;       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</errorStackTrace><failedSince>1</failedSince><name>testThumbnailVersion[set]</name><properties></properties><skipped>false</skipped><status>FAILED</status></caseResult>