[Bug] Jest worker process leak in model client.test.ts due to uncleaned timers

Open Beginner friendly
#838 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
api, testing-qa

Research direction

Start with rock/ts-sdk/src/model/client.test.ts and run pnpm test:unit, then use Jest's --detectOpenHandles option to identify the active timer. Clean up the leaked timer in the test teardown, and verify that all tests pass without the worker-exit warning.

Written by the indexing model from the issue text.

Description

bug

Bug Description
rock/ts-sdk/src/model/client.test.ts 中的 Jest 单元测试存在 timer 泄漏问题,导致 Jest worker 进程无法正常退出,被强制终止。

Steps to Reproduce

  1. cd rock/ts-sdk
  2. pnpm test:unit
  3. 测试全部通过后,观察控制台输出的警告信息

Expected Behavior
所有单元测试通过后,Jest 进程正常退出,无任何警告。
Actual Behavior
所有测试通过,但 Jest 打印 worker 泄漏警告并强制终止 worker 进程。
Error Logs
A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --detectOpenHandles to find leaks. Active timers can also cause this, ensure that .unref() was called on them.
Environment Information

  • OS: [e.g. Ubuntu 22.04, macOS 13.0, Windows 11]
  • Python Version: [e.g. 3.11.5]
  • ROCK Version: [e.g. 0.2.0]
  • Installation Method: [e.g. pip install rl-rock, source installation with uv]
  • Docker Version: [e.g. 24.0.6] (if using sandbox features)
  • Deployment Type: [e.g. local, distributed, ray]

ROCK Configuration

  • Runtime Environment Type: uv
  • Sandbox Image: python:3.11
  • Resource Allocation: default

Component Affected

  • Sandbox
  • Actions
  • Deployments
  • SDK & API
  • Envhub
  • CLI
  • Performance & Optimization
  • Documentation & Examples
Dominant language
Python
Stars
485
Forks
81
Avg merge
17h 45m
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from alibaba/ROCK

All issues in alibaba/ROCK

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.