Eventually() should have a variable time delay
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Autopilot |
Fix Released
|
Wishlist
|
Unassigned | ||
autopilot (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Looking at the code for Autopilot it seems that Eventually is hard coded to wait for 10 seconds. In playing with this with Checkbox, I found that sometimes that 10 second delay is not enough.
For example, it takes 15 - 20 seconds for buttonStartTesting to become enabled once tabTestList is visible because of some background stuff going on with checkbox at this point of the run. because of this, I have to introduce a sleep() call to force some extra time.
It would be nice if Eventually() accepted a wait time in seconds. Even better if this was passed through other things that call it. For example: assertProperty(
sleep(20)
assertProperty(
it will sleep for 20 seconds, then assertProperty calls Eventually() internally which adds another 10 second delay.
Related branches
- Christopher Lee (community): Approve
- PS Jenkins bot: Pending (continuous-integration) requested
-
Diff: 205 lines (+126/-12)3 files modifiedautopilot/introspection/dbus.py (+12/-5)
autopilot/matchers/__init__.py (+15/-7)
autopilot/tests/test_matchers.py (+99/-0)
tags: | added: certification |
summary: |
- Eventuallyr() should have a variable time delay + Eventually() should have a variable time delay |
Changed in autopilot: | |
status: | Incomplete → In Progress |
Changed in autopilot: | |
status: | In Progress → Fix Committed |
Changed in autopilot: | |
status: | Fix Committed → Fix Released |
Hi Jeff,
This sounds like a do-able feature addition. Thinking about it from an API point of view, would you be happy with this?
self.assertThat (foo.something, Eventually( Equals( 24), timeout=20)
... to make Eventually wait 20 seconds. Leaving the keywork property out:
self.assertThat (foo.something, Eventually( Equals( 24))
would default to 10 seconds.
AssertProperty is harder to fix - since there's no easy way to differentiate between a 'timeout' keyword, and a test against an attribute called 'timeout'.
Another option is to have some call like:
self.setAsserti onTimeout( 20)
which would set the timeout value to 20 seconds for the current test only. It's less fine-grained, but would work for both assertions.
I'm keen to get your feedback on this.
Cheers,