# Timeout — Async callback was not invoked within 5000ms (Jest)

Source: https://www.observeone.com/community/errors/jest/async-timeout

[ObserveOne](/)[Features](/#features)[Pricing](/#pricing)[Blog](/blog)[CLI](/cli)[Docs](/docs)

[Sign in](https://app.observeone.com/auth?tab=signin)[Start Free](https://app.observeone.com/auth?tab=signup)

[Error Dictionary](/community/errors)/[Jest](/community/errors/jest)/async-timeouthigh

# Timeout — Async callback was not invoked within 5000ms

An async test did not complete within the default 5-second timeout. The async operation may be hanging, or done() was never called.

## Common Causes

- 1Forgotten await on an async function
- 2done() callback never called in callback-style tests
- 3API call or network request hanging
- 4Infinite loop in the code under test
- 5Timer (setTimeout) not faked and waiting for real time

## How to Fix

### Use async/await instead of done callback

// Instead of:
it('fetches data', (done) => {
 fetchData().then(data => {
 expect(data).toBeDefined();
 done();
 });
});

// Use:
it('fetches data', async () => {
 const data = await fetchData();
 expect(data).toBeDefined();
});async/await is cleaner and less error-prone than the done() callback pattern.

### Increase timeout for slow tests

it('slow test', async () => {
 // ...
}, 30000); // 30 second timeoutPass a timeout value as the third argument to it() or test().

### Use fake timers for setTimeout

jest.useFakeTimers();

it('debounces input', () => {
 handleInput('test');
 jest.advanceTimersByTime(500);
 expect(callback).toHaveBeenCalled();
});Fake timers allow you to control time without actually waiting.

## How ObserveOne Helps

ObserveOne identifies slow and flaky tests caused by timing issues and recommends fixes.

[Start Monitoring Free](https://app.observeone.com/auth?tab=signup)

## Related Errors

[UnhandledPromiseRejectionWarningA Promise was rejected but no .catch() handler or try/catch block caught the error. This can cause flaky tests or missed failures.](/community/errors/jest/unhandled-promise-rejection)[Cannot find module './Component'Jest could not resolve a module import. The file may not exist, the path may be wrong, or the module resolution config may be misconfigured.](/community/errors/jest/cannot-find-module)[SyntaxError: Unexpected tokenJest encountered syntax it cannot parse. This usually means a file needs to be transformed (e.g., TypeScript, JSX, ESM) but the transformer is not configured.](/community/errors/jest/unexpected-token)[Snapshot mismatch — expected value to match snapshotThe rendered output does not match the stored snapshot. The component output changed since the snapshot was last updated.](/community/errors/jest/snapshot-mismatch)[Jest mock not being called / not returning expected valueA jest.mock() or jest.fn() is not behaving as expected — either not being called, not returning the mocked value, or not intercepting the real implementation.](/community/errors/jest/mock-not-working)

ObserveOne

Agentic QA and synthetic monitoring built for engineering teams. Plan, generate, and run suites from the web UI. Connect to CI for reliable coverage across critical journeys.

### Product

- [Features](/#features)
- [Pricing](/#pricing)
- [QA Coverage](/qa-coverage)
- [API Monitoring](/api-monitoring)
- [Free Website Check](/free-website-check)

### Developers

- [CLI](/cli)
- [Docs](/docs)
- [For Agents](/agents)
- [Self-host (oo-workers)](/workers)
- [Status Pages](/status)
- [Netlify Extension](https://app.netlify.com/extensions/mzs1lgc3-observeone)

### Resources

- [Blog](/blog)
- [Bug Book](/bug-book)
- [Guides](/community/guides)
- [Tools](/community/tools)
- [Error Dictionary](/community/errors)

### Compare

- [Tool Comparisons](/compare)
- [Tool Alternatives](/alternatives)
- [Best by Category](/best)
- [Search](/search)

© 2026 ObserveOne. All rights reserved.

[About](/about)[Privacy Policy](/privacy)[Terms of Service](/terms)[Affiliates](/affiliates)[Become an Affiliate](/affiliate-terms)
