From 0859912a7e1d49a1f3f7f871edd144376b169ced Mon Sep 17 00:00:00 2001 From: Mike MacCana Date: Fri, 23 Aug 2024 12:44:03 -0400 Subject: [PATCH] Fix slow warnings for favorites program tests --- basics/favorites/anchor/tests/favorites.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/basics/favorites/anchor/tests/favorites.ts b/basics/favorites/anchor/tests/favorites.ts index a48e848e..c01c27a6 100644 --- a/basics/favorites/anchor/tests/favorites.ts +++ b/basics/favorites/anchor/tests/favorites.ts @@ -6,6 +6,8 @@ import type { Favorites } from '../target/types/favorites'; import { systemProgramErrors } from './system-errors'; const web3 = anchor.web3; +const SECONDS = 1000; + describe('Favorites', () => { // Use the cluster and the keypair from Anchor.toml const provider = anchor.AnchorProvider.env(); @@ -49,7 +51,7 @@ describe('Favorites', () => { assert.equal(dataFromPda.number.toString(), favoriteNumber.toString()); // And check the hobbies too assert.deepEqual(dataFromPda.hobbies, favoriteHobbies); - }); + }).slow(4 * SECONDS); it('Updates the favorites', async () => { const newFavoriteHobbies = ['skiing', 'skydiving', 'biking', 'swimming']; @@ -60,7 +62,7 @@ describe('Favorites', () => { const customErrorMessage = getCustomErrorMessage(systemProgramErrors, error); throw new Error(customErrorMessage); } - }); + }).slow(4 * SECONDS); it('Rejects transactions from unauthorized signers', async () => { try { @@ -75,5 +77,5 @@ describe('Favorites', () => { const errorMessage = (error as Error).message; assert.isTrue(errorMessage.includes('unknown signer')); } - }); + }).slow(4 * SECONDS); });