MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / checkResult

Function checkResult

src/test/helpers.ts:1320–1330  ·  view source on GitHub ↗
(timeMS: number)

Source from the content-addressed store, hash-verified

1318 const subsequentCheck = 10000;
1319 const maxTime = 60000;
1320 const checkResult = (timeMS: number) => {
1321 if (didComplete)
1322 return;
1323 logCompletion = true;
1324 logger.info(`Promise ${name} is still unresolved!`, LogCategory.CI);
1325 if (timeMS > maxTime) {
1326 logger.error(`[${activeTestName}] Promise ${name} not resolved after ${maxTime}ms so no longer watching!`, LogCategory.CI);
1327 return;
1328 }
1329 setTimeout(() => checkResult(timeMS + subsequentCheck), subsequentCheck).unref();
1330 };
1331 setTimeout(() => checkResult(initialCheck), initialCheck).unref(); // First log is after 3s, rest are 10s.
1332
1333 return promise;

Callers 1

watchPromiseFunction · 0.85

Calls 2

infoMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected