Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interact does not work when using infinite timeout #66

Open
jacobthughes opened this issue Jan 10, 2020 · 0 comments
Open

Interact does not work when using infinite timeout #66

jacobthughes opened this issue Jan 10, 2020 · 0 comments

Comments

@jacobthughes
Copy link

Using .withInfiniteTimout() sets the timeout value to -1.
In the until method of InteractBuilderImpl we then have the following:

final long time = System.currentTimeMillis();
...
if (System.currentTimeMillis() - time > expect.getTimeout()) {
        LOG.fine("Until matching operation timeout");
        return (R) SimpleResult.failure(inputBuffer, true);
}

Since getTimeout() will evaluate to -1, this will enter the if statement and return as a failure.
So any interact statement I built using an expect with infinite timeout will not function, and will simply exit without even evaluating the matchers.

Setting the timeout to something huge (e.g. 10 days) is a work-around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant