1

I am experiencing an intermittent problem when running my automated tests using Thucydides:

Result: WARN Failed to write scaled screenshot for net.thucydides.core.model.Screenshot@82df887: {} java.io.IOException: Failed to copy full contents from 'target/site/thucydides/2a645999ca0b3b04597680646ce26149_NONE.png' to 'target/site/thucydides/scaled_2a645999ca0b3b04597680646ce26149_NONE.png'

The command I run is like this: mvn -Dit.test=MyTestClass verify

I am using much of the Thucydides structures in terms of @Steps, @StepGroup, @WithTag, and @Story annotations.

I seem to get this error when running multiple tests and not just one test.

Playing with thucydides.keep.unscaled.screenshots makes no difference.

I have found only one other related issue posted on Google groups but it does not have a resolution (as of 2014-11-06).

My configuration settings:

  • OS: Mac OSX Yosemite (10.10) (Happens on 10.9 too)
  • mvn: Apache Maven 3.1.1
  • Java: 1.7.0_51
  • Thucydides: 0.9.273 (0.9.275 fails also)
  • Selenium: 2.42.2 -
  • Browser: FireFox v28 (I've tried 27 & 31 same problem, Chrome 38, Safari 7.1 all seem to show similar or identical problems)

Any pointers are much appreciated. A related problem here is that if you tag on thucydides:aggregate onto the mvn command line, and it fails as above, Thucydides will not generate an index.html file.

user1814008
  • 201
  • 3
  • 9

1 Answers1

0

This appears to be a problem with how screenshots are managed. The working theory (unconfirmed by Thucydides authors) on why this happens seems to be rooted in the strategy of Thucydides saving time and space by reusing screenshots. Apparently, the reporting engine will take a screenshot, do some scaling, resave the file, etc...If a second test comes along that has an md5-identical screenshot to that of another test, it will try to reuse it. However, if for some reason that file is not available (due to a lock or not present, etc...) then you can see this error.
To confirm this suspicion I took the sample Thucydides app built from instructions here:

and duplicated one of the tests (copy the test method, alter the name slightly) and ran 'verify'. Sure enough, I was able to reproduce the problem.

user1814008
  • 201
  • 3
  • 9