• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

assertThat and long timeout  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This might be a silly question, so sorry:

I'm a java noob, but I'm playing with some code using Java8 and Selenium for testing a web applications.

I've been told that assertThat is the preferred method to do assertions. But I'm wondering: Is there supposed to be a long timeout before an assertThat fails? In my example, I'm asserting something I KNOW is not true, and it takes about one minute before the assertion fails.
Once it fails, it presents nice feedback about what failed, but I don't understand why it takes so long to fail?



The code is pretty easy and self-explanatory, I think. The two string values are sound. But the assertion takes about a minute to fail. Why is that? In my case, it's a problem because there are hundreds of these assertions in the code, and the time to run the whole suite is potentially much longer if every failed assertion adds a minute to the run time.

Any ideas? Again, sorry if this is too basic or stupid.
 
Ranch Hand
Posts: 96
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch  

It could be your method is also taking long to run. Check how long does the method that returns caseRef takes to run. The good practice will be to use the mocks against the actual call if the method is making calls to the database or external services perhaps.
 
Denne Fyren
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tips. It turned out that the problem was the framework and operations that were automatically executed every time a test and/or assert failed.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!