Shawn Walker wrote:
On 02/11/10 01:22 PM, Brock Pytlik wrote:
Shawn Walker wrote:
The following webrev contains fixes for the following issue (3 lines,
but webrev posted for clarity):
14515 client can traceback during search
webrev:
http://cr.opensolaris.org/~swalker/pkg-14515/
I'd like to add a unit test for this, but can't think of a good way to
do so since it is a timing-related failure.
Cheers,
LGTM
How's it timing related?
From what I see in the code, the assert would only fail if res is
empty or undefined, and that would only happen if page_again is True?
If you could help explain the "res or consec_dup_lines" that would
help me formulate a test case since all the current tests pass already.
Well, last_res is the last line of the previous page, if any exist.
remove_consec_dup_lines is the boolean that determines whether
consecutive duplicate lines are removed or not.
The only way to make this happen by calling pkg search in the test suite
would be to have enough return values (or a slow enough server) that it
starts paging the output. That's hard to accomplish in the test suite.
Not impossible, though. My suggestion for a test is to make it an api
test and simply call produce_lines with the values set in an appropriate
way to cause the assert to fail.
A third option would be to extract the constants from search and make
them global variables, then twiddle the page_timeout from the test suite
to set it to 0, so that you page frequently.
Brock
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss