• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

assertThat and long timeout  RSS feed

 
Greenhorn
Posts: 6
  • 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: 99
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: 6
  • 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.
 
I am mighty! And this is a mighty small ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!