diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c25d543..01872ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,6 +48,7 @@ jobs: # Defines the WordPress and PHP Versions matrix to run tests on. strategy: fail-fast: false + max-parallel: 1 matrix: wp-versions: [ 'latest' ] #[ '6.1.1', 'latest' ] php-versions: [ '8.0', '8.1', '8.2', '8.3', '8.4' ] #[ '7.4', '8.0', '8.1', '8.2' ] diff --git a/tests/Integration/APITest.php b/tests/Integration/APITest.php index 0ad858e..1620130 100644 --- a/tests/Integration/APITest.php +++ b/tests/Integration/APITest.php @@ -4245,15 +4245,15 @@ public function testUpdateSubscriberWithInvalidSubscriberID() */ public function testUnsubscribeByEmail() { - // Avoid a rate limit due to previous tests. - sleep(2); - // Add a subscriber. $emailAddress = $this->generateEmailAddress(); $result = $this->api->create_subscriber($emailAddress); $this->assertNotInstanceOf(\WP_Error::class, $result); $this->assertIsArray($result); + // Wait a moment to ensure subscriber is created. + sleep(3); + // Unsubscribe. $this->assertNull($this->api->unsubscribe_by_email($emailAddress)); } @@ -4301,6 +4301,9 @@ public function testUnsubscribe() $this->assertNotInstanceOf(\WP_Error::class, $result); $this->assertIsArray($result); + // Wait a moment to ensure subscriber is created. + sleep(3); + // Unsubscribe. $this->assertNull($this->api->unsubscribe($result['subscriber']['id'])); }