yanne / api-test

0 stars 0 forks source link

Support waiting for more content with `Read` #90

Closed yanne closed 10 years ago

yanne commented 10 years ago

Currently Read keyword just reads everything available on the server output buffer. It is thus possible that server writes more content after while reading the old output or immediately after that. It would be convenient to be able to wait until all output is written.

We decided to add new delay argument to Read that tells the keyword to behave like this:

1) Wait until the delay. 2) Read. 3a) If there was any text, return to 1). 3b) If nothing was returned, exit.

The keyword should never wait indefinitely, though, but instead use the same timeout that different Read Until ... keywords use.

The default value for delay should be None, and that should mean not using any delays. This way the default behavior does not change.

This issue was originally opened at Google Code on Oct 17, 2013.

yanne commented 10 years ago

Original comment by anssi.sy...@eficode.com on Oct 22, 2013.

This issue was updated by revision 81661d45b2dd .

This is now implemented.

yanne commented 10 years ago

Original comment by anssi.sy...@eficode.com on Oct 23, 2013.

This issue was updated by revision 50ad7cf0ef90 .

This was fixed to work so that Read only checks for more server output if argument delay is specified. If no delay is in use (which is the default), Read behaves as before, being backward compatible.

yanne commented 10 years ago

Original comment by anssi.sy...@eficode.com on Oct 25, 2013.

This issue was updated by revision 83a337cb11b0 .

There was a small bug in returning from Read keyword when the timeout has expired. That is now fixed.

Also the keyword internals was changed so that Read always reads once immediately and additionally, if delay has been given, the keyword reads again at least once after the delay. Also the keyword documentation was updated to match this behaviour.

yanne commented 10 years ago

Original comment by robotframework@gmail.com on Oct 30, 2013.

This issue was updated by revision cc63f26619d6 .

Looks good. Enhanced the doc a little.