From 7d9ea586568a3486999d0ed7b09ab9783ef2773c Mon Sep 17 00:00:00 2001 From: Mike Auteri Date: Sun, 28 Jan 2024 09:23:40 -0500 Subject: [PATCH 1/2] Added slight delay for occasionally failing test. --- test/unit/php/includes/core/classes/class-test-rsvp.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/unit/php/includes/core/classes/class-test-rsvp.php b/test/unit/php/includes/core/classes/class-test-rsvp.php index 953a0a5f5..2eb752842 100644 --- a/test/unit/php/includes/core/classes/class-test-rsvp.php +++ b/test/unit/php/includes/core/classes/class-test-rsvp.php @@ -127,6 +127,9 @@ public function test_check_waiting_list(): void { $rsvp->save( $user_1_id, 'not_attending' ); + // Give it a slight delay to move member from waiting_list to attending (w/o test sometimes fails). + sleep(.1); + $this->assertSame( 'attending', $rsvp->get( $user_3_id )['status'], 'Failed to asser user 3 is on attending.' ); $this->assertSame( 0, $rsvp->check_waiting_list(), 'Failed to assert expected waiting list value.' ); From 1cea029965eee99a5bed36162f006e679c5d7611 Mon Sep 17 00:00:00 2001 From: Mike Auteri Date: Sun, 28 Jan 2024 09:26:02 -0500 Subject: [PATCH 2/2] PHPCS fix. --- test/unit/php/includes/core/classes/class-test-rsvp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/php/includes/core/classes/class-test-rsvp.php b/test/unit/php/includes/core/classes/class-test-rsvp.php index 2eb752842..654001c55 100644 --- a/test/unit/php/includes/core/classes/class-test-rsvp.php +++ b/test/unit/php/includes/core/classes/class-test-rsvp.php @@ -128,7 +128,7 @@ public function test_check_waiting_list(): void { $rsvp->save( $user_1_id, 'not_attending' ); // Give it a slight delay to move member from waiting_list to attending (w/o test sometimes fails). - sleep(.1); + sleep( .1 ); $this->assertSame( 'attending', $rsvp->get( $user_3_id )['status'], 'Failed to asser user 3 is on attending.' ); $this->assertSame( 0, $rsvp->check_waiting_list(), 'Failed to assert expected waiting list value.' );