{"record":{"id":"28f3a2ab8f21ff7d","repo":"ruvnet/ruflo","slug":"condition-not-met-within-timeout","errorCode":null,"errorMessage":"Condition not met within timeout","messagePattern":"Condition not met within timeout","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/testing/src/helpers/test-utils.ts","lineNumber":38,"sourceCode":"    timeout = 5000,\n    interval = 50,\n    timeoutMessage = 'Condition not met within timeout',\n  } = options;\n\n  const startTime = Date.now();\n\n  while (true) {\n    try {\n      const result = await condition();\n      if (result) {\n        return result;\n      }\n    } catch (error) {\n      // Condition threw, continue waiting\n    }\n\n    if (Date.now() - startTime >= timeout) {\n      throw new Error(timeoutMessage);\n    }\n\n    await sleep(interval);\n  }\n}\n\n/**\n * Options for waitFor utility\n */\nexport interface WaitForOptions {\n  timeout?: number;\n  interval?: number;\n  timeoutMessage?: string;\n}\n\n/**\n * Wait until a value changes\n *","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/testing/src/helpers/test-utils.ts#L20-L56","documentation":"waitFor polled the condition function every interval ms until the timeout elapsed and it never returned truthy (thrown errors were swallowed and treated as not-yet). This is the generic wait-for-condition timeout: the awaited async state simply never became true within the deadline.","triggerScenarios":"Thrown at v3/@claude-flow/testing/src/helpers/test-utils.ts:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Increase the waitFor timeout if the condition legitimately takes longer.","Fix the system under test so the condition becomes true, or correct the predicate."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}