Fixes for tests

This commit is contained in:
David Bomba 2023-02-01 09:52:12 +11:00
parent 228f3af4b9
commit 4a968e739c
4 changed files with 3 additions and 8 deletions

View File

@ -73,7 +73,6 @@ class GmailTransport extends AbstractTransport
/* Need to slow down */
if($e->getCode() == '429') {
sleep(rand(5,10));
nlog("429 google - retrying ");
$service->users_messages->send('me', $body, []);

View File

@ -75,7 +75,7 @@ class NinjaMailerJob implements ShouldQueue
public function backoff()
{
return [30, 60, 180, 240];
return [5, 10, 30, 240];
}
public function handle()
@ -445,7 +445,6 @@ class NinjaMailerJob implements ShouldQueue
$message->getHeaders()->addTextHeader('gmailtoken', $token);
});
sleep(rand(1,3));
}
/**
@ -472,7 +471,6 @@ class NinjaMailerJob implements ShouldQueue
$google->getClient()->setAccessToken(json_encode($user->oauth_user_token));
sleep(rand(1,6));
}
catch(\Exception $e) {
$this->logMailError('Gmail Token Invalid', $this->company->clients()->first());

View File

@ -59,7 +59,7 @@ class EmailMailer implements ShouldQueue
public function backoff()
{
return [30, 60, 180, 240];
return [10, 30, 60, 240];
}
public function handle(): void
@ -379,7 +379,6 @@ class EmailMailer implements ShouldQueue
$message->getHeaders()->addTextHeader('gmailtoken', $token);
});
sleep(rand(1,3));
}
/**
@ -406,7 +405,6 @@ class EmailMailer implements ShouldQueue
$google->getClient()->setAccessToken(json_encode($user->oauth_user_token));
sleep(rand(2,4));
}
catch(\Exception $e) {
$this->logMailError('Gmail Token Invalid', $this->email_service->company->clients()->first());

View File

@ -433,7 +433,7 @@ class BaseApiTest extends TestCase
'X-API-SECRET' => config('ninja.api_secret'),
'X-API-TOKEN' => $this->low_token,
])->get('/api/v1/companies/'.$this->company->hashed_id)
->assertStatus(401);
->assertStatus(403);
}