However, it's not obvious whether the test actually checks how long the
validation takes, or what "forever" really means (e.g. is 1 second
forever?). For example, I couldn't see any measurement of elapsed time in
the tests.
It would be good if the comment elaborated on this and, if necessary, the
test could check that validation doesn't take too long.
--
Ticket URL: <https://code.djangoproject.com/ticket/32958>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => needsinfo
Comment:
> However, it's not obvious whether the test actually checks how long the
validation takes, or what "forever" really means (e.g. is 1 second
forever?). For example, I couldn't see any measurement of elapsed time in
the tests.
In this case "forever" means minutes (maybe hours). It's hard to estimate
an upper bound, there are too many variables and we don't want to add a
flaky test that fails on contributors computers.
> ... if necessary, the test could check that validation doesn't take too
long.
Do you have a suggestion on how to handle this?
We can clarify a comment, but I don't think it's feasible to add a not
error-prone test based on runtime.
--
Ticket URL: <https://code.djangoproject.com/ticket/32958#comment:1>
* type: Uncategorized => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/32958#comment:2>
Comment (by Chris Jerdonek):
> Do you have a suggestion on how to handle this?
I had two changes in mind. The first was to update the comment with more
explanation of what forever means. It can be as simple as adding what you
said, e.g. "Trailing junk does not take forever to reject (minutes, maybe
hours)."
The second was to add e.g. a context manager around each validation test
case to check that the validation doesn't take longer than some amount of
time. That would serve to check that it doesn't take forever. If the time
is generous enough (e.g. 1 second?), there shouldn't be any risk of
flakiness. (Unlike with other flaky tests, there is no I/O happening
here.) If forever is truly minutes or hours, then even 60 seconds could
work. But I think that might be unnecessarily generous.
--
Ticket URL: <https://code.djangoproject.com/ticket/32958#comment:3>