Skip to content

Commit d215afa

Browse files
committed
add delay for pgsql
1 parent 1af92d1 commit d215afa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/review_test.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ public function test_forum_review_everything(): void {
118118
$posts = $this->create_post($options);
119119
$this->check_mail_records($posts['teacherpost'], $posts['studentpost'], 1, 0, MOODLEOVERFLOW_MAILED_REVIEW_SUCCESS);
120120

121+
if ($CFG->branch >= 404) {
122+
sleep(1); // Added delay
123+
}
121124
$this->assertEquals(1, $this->mailsink->count()); // Teacher has to approve student message.
122125
$this->assertEquals(2, $this->messagesink->count()); // Student and teacher get notification for student message.
123126

@@ -182,6 +185,9 @@ public function test_forum_review_only_questions(): void {
182185
$posts = $this->create_post($options);
183186
$this->check_mail_records($posts['teacherpost'], $posts['studentpost'], 1, 0, MOODLEOVERFLOW_MAILED_REVIEW_SUCCESS);
184187

188+
if ($CFG->branch >= 404) {
189+
sleep(1); // Added delay
190+
}
185191
$this->assertEquals(1, $this->mailsink->count()); // Teacher has to approve student message.
186192
$this->assertEquals(2, $this->messagesink->count()); // Student and teacher get notification for student message.
187193

@@ -215,6 +221,7 @@ public function test_forum_review_only_questions(): void {
215221
* Test reviews functionality when reviewing is allowed in admin settings.
216222
*/
217223
public function test_forum_review_disallowed(): void {
224+
global $CFG;
218225
$options = ['course' => $this->course->id, 'needsreview' => review::EVERYTHING,
219226
'forcesubscribe' => MOODLEOVERFLOW_FORCESUBSCRIBE, ];
220227

@@ -223,6 +230,9 @@ public function test_forum_review_disallowed(): void {
223230
$posts = $this->create_post($options);
224231
$this->check_mail_records($posts['teacherpost'], $posts['studentpost'], 1, 1, MOODLEOVERFLOW_MAILED_SUCCESS);
225232

233+
if ($CFG->branch >= 404) {
234+
sleep(1); // Added delay
235+
}
226236
$this->assertEquals(0, $this->mailsink->count()); // Teacher has to approve student message.
227237
$this->assertEquals(4, $this->messagesink->count()); // Student and teacher get notification for student message.
228238

0 commit comments

Comments
 (0)