File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1111
1212namespace ONGR \ElasticsearchBundle \Test ;
1313
14+ use Elasticsearch \Common \Exceptions \ElasticsearchException ;
1415use ONGR \ElasticsearchBundle \Client \Connection ;
1516use ONGR \ElasticsearchBundle \ORM \Manager ;
1617use Symfony \Bundle \FrameworkBundle \Test \WebTestCase ;
@@ -43,12 +44,15 @@ public function runTest()
4344 foreach (range (1 , $ this ->getNumberOfRetries ()) as $ try ) {
4445 try {
4546 return parent ::runTest ();
46- } catch (\PHPUnit_Framework_SkippedTestError $ e ) {
47- throw $ e ;
48- } catch (\PHPUnit_Framework_IncompleteTestError $ e ) {
49- throw $ e ;
5047 } catch (\Exception $ e ) {
51- // Try more.
48+ if (!($ e instanceof ElasticsearchException)) {
49+ throw $ e ;
50+ }
51+ // If error was from elasticsearch re-setup tests and retry.
52+ if ($ try !== $ this ->getNumberOfRetries ()) {
53+ $ this ->tearDown ();
54+ $ this ->setUp ();
55+ }
5256 }
5357 }
5458
You can’t perform that action at this time.
0 commit comments