Skip to content

Commit 28fd137

Browse files
fix: Bump default ping timeout (#3773)
Bump default ping timeout to 10 seconds to improve stability on systems where initializing the Snaps Platform may take a bit of time. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Increase default ping timeout to 10s and update tests to explicitly set a shorter timeout for ping failure behavior. > > - **Controllers** > - `AbstractExecutionService`: Bump default `pingTimeout` from `2s` to `10s` in constructor. > - **Tests** > - `AbstractExecutionService.test.ts`: Configure `createService` with `pingTimeout: 1s` for the ping timeout failure test. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f2f1975. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 8389c5b commit 28fd137

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/snaps-controllers/src/services/AbstractExecutionService.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ describe('AbstractExecutionService', () => {
3838
});
3939

4040
it('throws an error if execution environment fails to respond to ping', async () => {
41-
const { service } = createService(MockExecutionService);
41+
const { service } = createService(MockExecutionService, {
42+
pingTimeout: inMilliseconds(1, Duration.Second),
43+
});
4244

4345
class MockStream extends BasePostMessageStream {
4446
protected _postMessage(_data?: unknown): void {

packages/snaps-controllers/src/services/AbstractExecutionService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export abstract class AbstractExecutionService<WorkerType>
102102
setupSnapProvider,
103103
messenger,
104104
initTimeout = inMilliseconds(60, Duration.Second),
105-
pingTimeout = inMilliseconds(2, Duration.Second),
105+
pingTimeout = inMilliseconds(10, Duration.Second),
106106
terminationTimeout = inMilliseconds(1, Duration.Second),
107107
usePing = true,
108108
}: ExecutionServiceArgs) {

0 commit comments

Comments
 (0)