Skip to content

Navigation Menu

Sign in
Sign up

Critical Performance Issue #53

Open

Description

Describe the bug
if I don't interact with the process, expect() takes increasing time to return.
what is most strange is that elapsed time will slowly approach the time between two sendline (inactivity time).
More time passes between two sendline, more times it takes for returning after I execute a new sendline().

To Reproduce

import wexpect
import time
child = wexpect.spawn('cmd.exe')
child.expect('>')
for _ in range(10):
 child.sendline('echo "hello"')
 starting_time = time.time()
 child.expect('>')
 print("Expect Elapsed time:",time.time() -starting_time)
 time.sleep(5) #if you execute sleep(10) expect will soon take 10 seconds instead of 5
child.sendline('exit')
child.wait()

Expected behavior
"Expect elapsed time" shouldn't depend on how much time I didn't iteracted with the process.

Output
Expect Elapsed time: 0.07507729530334473
Expect Elapsed time: 2.6089940071105957
Expect Elapsed time: 3.860004425048828
Expect Elapsed time: 4.498199224472046
Expect Elapsed time: 4.816983938217163
Expect Elapsed time: 4.947844982147217
Expect Elapsed time: 5.021565198898315
Expect Elapsed time: 5.082917213439941
Expect Elapsed time: 5.092726707458496
Expect Elapsed time: 5.106329441070557

Environment:

  • [windows version] 21H1 - Build 19043.1348
  • [Python version] 3.85
  • [wexpect version] 4.0.0

Activity

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

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /