Skip to content

Commit fb6b661

Browse files
fix(ci): Add more "sleep" between API calls and update changelog
Refs: #163
1 parent 221e7c6 commit fb6b661

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changes between versions
22

3+
## Unreleased (2025)
4+
5+
* Upgrade JanePHP generated code
6+
* Improve the Cursor paginated methods, add missing and remove obsoletes
7+
38
## 4.7.1 (2024-06-28)
49

510
* Upgrade JanePHP generated code

tests/ClientTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public function testAllCursorPaginationMethodExists()
6262
$getterMethod = 'get' . $getterMethod;
6363
$method = lcfirst(str_replace('iterate', '', $methodName));
6464

65+
if ($_SERVER['CI'] ?? false) {
66+
sleep(5); // @see https://github.com/jolicode/slack-php-api/issues/163
67+
}
68+
6569
$responseFromMethod = $client->{$method}($this->argumentsForCursorPaginationRequest($method, $client));
6670

6771
self::assertTrue(

tests/SlackTokenDependentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function createClient(?string $token = null): Client
3131
// On GitHub Action, we get rate limit issues with Slack API calls because tests are run in parallel
3232
// This "sleep" method tries to share the load.
3333
if ($_SERVER['CI'] ?? false) {
34-
sleep(rand(1, 10));
34+
sleep(5); // @see https://github.com/jolicode/slack-php-api/issues/163
3535
}
3636

3737
return ClientFactory::create(null === $token ? $_SERVER['SLACK_TOKEN'] : $token);

tests/WritingTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ public function testItCanPostAMessageAndThenAThreadResponse(): void
8888
'text' => 'First message',
8989
]);
9090

91+
if ($_SERVER['CI'] ?? false) {
92+
sleep(5); // @see https://github.com/jolicode/slack-php-api/issues/163
93+
}
94+
9195
$response2 = $client->chatPostMessage([
9296
'username' => 'User B',
9397
'channel' => $_SERVER['SLACK_TEST_CHANNEL'],
@@ -150,6 +154,10 @@ public function testItCanMarkConversation(): void
150154

151155
$ts = $response->getTs();
152156

157+
if ($_SERVER['CI'] ?? false) {
158+
sleep(5); // @see https://github.com/jolicode/slack-php-api/issues/163
159+
}
160+
153161
$markResponse = $client->conversationsMark([
154162
'channel' => $_SERVER['SLACK_TEST_CHANNEL'],
155163
'ts' => $ts,

0 commit comments

Comments
 (0)