add a wait and retry for test that can fail on slower/busy machines

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@782691 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2009-06-08 16:07:12 +00:00
parent c1efe96c47
commit 74c10140ce
1 changed files with 8 additions and 0 deletions

View File

@ -229,6 +229,14 @@ abstract public class SolrExampleTests extends SolrExampleTestBase
// now check that it comes out...
rsp = server.query( new SolrQuery( "id:id3") );
if(rsp.getResults().getNumFound() == 0) {
// wait and try again for slower machines
Thread.sleep( 2000 ); // wait 1/2 seconds...
rsp = server.query( new SolrQuery( "id:id3") );
}
Assert.assertEquals( 1, rsp.getResults().getNumFound() );
}