Skip to content

Commit

Permalink
add delay for pgsql
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaroWalter committed May 24, 2024
1 parent 1af92d1 commit d215afa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/review_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public function test_forum_review_everything(): void {
$posts = $this->create_post($options);
$this->check_mail_records($posts['teacherpost'], $posts['studentpost'], 1, 0, MOODLEOVERFLOW_MAILED_REVIEW_SUCCESS);

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

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

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

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

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

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

Expand Down

0 comments on commit d215afa

Please sign in to comment.