Screenshot resizing error when using thucydides.resized.image.width

135 views
Skip to first unread message

Marlon Monzon

unread,
Mar 6, 2015, 2:30:12 AM3/6/15
to thucydid...@googlegroups.com
Hi,

I have a question regarding the resizing of screenshots.

We have this line inside our serenity.properties:

serenity.resized.image.width=1024

But we are encountering errors that looks like this:

[Thread-1] WARN net.thucydides.core.screenshots.SingleThreadScreenshotProcessor - Failed to resize screenshot: using original size C:\Users\jenkins\AppData\Local\Temp\screenshot4126337401241902833.png: The process cannot access the file because it is being used by another process.

I looked inside the SingleThreadScreenshotProcessor class and saw this:

private void resizeScreenshot(QueuedScreenshot queuedScreenshot) {
            try {
                if (!queuedScreenshot.getDestinationFile().exists()) {
                    saveResizedScreenshot(queuedScreenshot);
                }
                Files.deleteIfExists(queuedScreenshot.getSourceFile().toPath());
            } catch (Throwable e) {
                logger.warn("Failed to resize screenshot: using original size " + e.getMessage());
                moveScreenshot(queuedScreenshot);
            }
        }

Reading more about Files.deleteIfExists and The process cannot access the file because it is being used by another process lead me to these links:


Is this a Windows bug and we can't do anything about this? Or I am just doing something wrong or incomplete?

Thanks in advance for your help / response. :)

Regards,
Marlon
Reply all
Reply to author
Forward
0 new messages