mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 02:26:12 +02:00
test(slack): make rate-limit retry timing deterministic
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
bef1a0fada
commit
6a14cba143
1 file changed
+1
-1
@@ -4061,7 +4061,7 @@ describeEmbeddedPostgres("chat channel control-plane integration", () => {
|
|||||||
postFetch.mockReset();
|
postFetch.mockReset();
|
||||||
postFetch.mockImplementation(async (input, init) => {
|
postFetch.mockImplementation(async (input, init) => {
|
||||||
if (String(input).endsWith("/chat.postMessage")) {
|
if (String(input).endsWith("/chat.postMessage")) {
|
||||||
if (rejectNextSend) { rejectNextSend = false; return new Response("", { status: 429, headers: { "retry-after": "1" } }); }
|
if (rejectNextSend) { rejectNextSend = false; return new Response("", { status: 429, headers: { "retry-after": "3600" } }); }
|
||||||
return Response.json({ ok: true, channel: "CTOOLS", ts: "7200.2" });
|
return Response.json({ ok: true, channel: "CTOOLS", ts: "7200.2" });
|
||||||
}
|
}
|
||||||
if (String(input).endsWith("/conversations.create")) return Response.json({ ok: true, channel: { id: "CNEWCHANNEL" } });
|
if (String(input).endsWith("/conversations.create")) return Response.json({ ok: true, channel: { id: "CNEWCHANNEL" } });
|
||||||
|
|||||||
Reference in new issue
Block a user