[ticket/13241] Sleep for 1 second when posting twice in the same second

PHPBB3-13241
This commit is contained in:
Joas Schilling 2014-10-29 13:08:53 +01:00
parent 9ee177573d
commit e42202e794
2 changed files with 8 additions and 1 deletions

View file

@ -38,6 +38,7 @@ class phpbb_functional_test_case extends phpbb_test_case
static protected $config = array();
static protected $already_installed = false;
static protected $last_post_timestamp = 0;
static public function setUpBeforeClass()
{
@ -1098,6 +1099,12 @@ class phpbb_functional_test_case extends phpbb_test_case
*/
protected function submit_message($posting_url, $posting_contains, $form_data)
{
if (time() == self::$last_post_timestamp)
{
// Travis is too fast, so we have to wait to not mix up the post/topic order
sleep(1);
}
self::$last_post_timestamp = time();
$crawler = self::request('GET', $posting_url);
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());

View file

@ -26,7 +26,7 @@ class phpbb_test_case extends PHPUnit_Framework_TestCase
'PHP_Token_Stream' => array('customTokens'),
'PHP_Token_Stream_CachingFactory' => array('cache'),
'phpbb_database_test_case' => array('already_connected'),
'phpbb_database_test_case' => array('already_connected', 'last_post_timestamp'),
);
}