Skip to content

waitForTimeout and wait_for_timeout truncate millisecond waits #2134

Open

Description

@Elon-Jiang

wait_for_timeout(1500) and waitForTimeout(1500) currently produce sleep 1, so a template becomes ready about 500 ms before the requested duration. Both public helpers document milliseconds and a minimum of one second; values above that minimum should keep their fractional seconds.

import subprocess
import time
from e2b import wait_for_timeout

cmd = wait_for_timeout(1500).get_cmd()
start = time.monotonic()
subprocess.run(cmd, shell=True, check=True)
print(cmd, time.monotonic() - start)
# main: sleep 1, about 1.02 seconds
# expected: sleep 1.5, at least 1.5 seconds

Reproduced on main 3e72be3f08ec1a258ec0253c153df7ceed739f10, Python 3.12.13 on macOS arm64; the JavaScript regression also fails on the unchanged source. The whole-second and one-second-minimum controls pass. This runs the actual local shell command; it does not require or exercise a cloud sandbox.

A minimal fix and regression tests for both SDKs are prepared with Codex assistance under the contributor's authorization.

Activity

  1. added
    bug
    sdk
    on Nov 13, 2026
  2. devin-ai-integration commented on Nov 13, 2026

    @devin-ai-integration
    Contributor

    Triage

    • type: bug
    • priority: medium
    • complexity: trivial
    • affected_area: js-sdk/template readycmd + python-sdk/template readycmd (waitForTimeout / wait_for_timeout)
    • actionable: yes
    • needs_clarification: false
    • summary: waitForTimeout(ms) / wait_for_timeout(ms) floor the millisecond timeout to whole seconds (e.g. 1500 ms → sleep 1), so templates become ready early; non-whole-second values above the 1 s minimum should keep fractional seconds (e.g. sleep 1.5) in both SDKs.

    Written by Devin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsdk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions