mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/13241] Sleep for 1 second when posting twice in the same second
PHPBB3-13241
This commit is contained in:
parent
9ee177573d
commit
e42202e794
2 changed files with 8 additions and 1 deletions
|
@ -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());
|
||||
|
|
|
@ -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'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue