Skip to content

Commit 7f49b48

Browse files
test: add retries to speed sensitive tests
1 parent 3e95cb1 commit 7f49b48

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsFirewallAliasTestCase.inc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
namespace RESTAPI\Tests;
44

55
use RESTAPI\Core\TestCase;
6+
use RESTAPI\Core\TestCaseRetry;
67
use RESTAPI\Models\FirewallAlias;
78

89
class APIModelsFirewallAliasTestCase extends TestCase {
910
/**
1011
* Checks that aliases with hostnames correctly populate a pfctl table
1112
*/
12-
public function test_fqdn_alias_populates_pfctl_table() {
13+
#[TestCaseRetry(retries: 3, delay: 1)]
14+
public function test_fqdn_alias_populates_pfctl_table(): void {
1315
# Create an alias that includes dns.google as an alias item
1416
$test_alias = new FirewallAlias(
1517
data: [

pfSense-pkg-RESTAPI/files/usr/local/pkg/RESTAPI/Tests/APIModelsTableTestCase.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class APIModelsTableTestCase extends TestCase {
8282
/**
8383
* Checks that we can successfully delete (flush) entrries from a table
8484
*/
85+
#[TestCaseRetry(retries: 3, delay: 1)]
8586
public function test_delete(): void {
8687
# Create a new pf table to test with
8788
$this->add_table(table_name: 'pfrest_test_table', entries: ['1.2.3.4', '4.3.2.1']);

0 commit comments

Comments
 (0)