Search code examples
scalaspecs2

Specs2 .await timeout > 1s on CI server


I have some specs against a method returning a Future. On my local machine the futures complete around 30 to 80ms. On Travis-CI however the build may sometimes fails because a future took more than 1s. (The .await method creates a Future matcher that will fail after 1 second).

My first thought it to increase the timeout. I'd like to do it globally for all Specs2 Future matchers in the project. Is that possible? If not, is there's another (perhaps neater) workaround?


Solution

  • Using specs2-3.6.4 you can use the timefactor argument to multiply the standard duration (1 second) by a given factor.