py.saunter and SauceLabs OnDemand - teardown is not called

152 views
Skip to first unread message

Carol Mirakove

unread,
May 28, 2013, 5:21:20 PM5/28/13
to sau...@googlegroups.com
I am running
Sauce Connect 3.0-r28, build 43  
SeleniumServer 2.33 
py.saunter 0.61
using WebDriver with python bindings.

When I run my tests locally, I have no trouble.
When I run tests on SauceLabs ondemand, it appears the teardown method is not called. My test results are "Error" with the message "Test did not see a new command for 90 seconds. Timing out." When I add an explicit teardown statement to a test script, i.e., self.driver.quit(), then the test does end and is updated with Pass/Fail as expected although there is a WebDriver exception that I am digging through:

E       WebDriverException: Message: u'OKOK'

lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py:158: WebDriverException

Here is a gist with the test script that leads to an Error and a test script that yields a Pass/Fail result:

As I said, I'm digging through the stacktrace but wondered if anyone might have encountered this and has advice. My expectation was that setup and teardown methods for SauceLabs were baked into py.saunter, so I'm not sure if this is a bug or if my expectations are wrong.

Thanks!
Carol


--
Like us on Facebook: bitly | Bitly Enterprise
Follow us on Twitter: bitly | Bitly Enterprise
Follow us on LinkedIn
Add us on Google+

Adam Goucher

unread,
May 28, 2013, 7:50:15 PM5/28/13
to sau...@googlegroups.com
It 'should' just work. I'll have a look at it in a bit.

(Doing releases tonight so if there is a bug I'd rather squash it before I push.)

-adam
--
You received this message because you are subscribed to the Google Groups "Saunter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to saunter+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dakota Smith

unread,
May 28, 2013, 7:57:59 PM5/28/13
to sau...@googlegroups.com
Just to chime in I've seen the same. Did the same work around. Something in sauce seems to kill the remote before tear down. 

Adam Goucher

unread,
May 28, 2013, 8:00:27 PM5/28/13
to sau...@googlegroups.com
What if you put..

def teardown_method(self, method):
    super(CheckHomePage, self).teardown_method(method)

in there, does it behave?

Adam Goucher

unread,
May 28, 2013, 8:04:58 PM5/28/13
to sau...@googlegroups.com

Carol Mirakove

unread,
May 28, 2013, 9:16:49 PM5/28/13
to sau...@googlegroups.com
When I put 

def teardown_method(self, method):
    super(CheckHomePage, self).teardown_method(method)

in the CheckHomePage class, I got the Error result / it did not behave.

My conftest.py was almost identical to the one in your example, Adam, with one unrelated difference on line 32 where I had
        raise
instead of 
        raise(e)
(I've updated mine but again that's in a function unrelated to this issue).

I dug through the stacktrace of the error but I'm not seeing the source of the problem -
(To be clear, this is the error I see in my Terminal when I *do* explicitly call self.driver.quit() in my test script and the test is marked Pass; it's more informative than the error that I see when the test result in SauceLabs is Error, but the stacktrace in the Error case is basically the same -

Thanks, Adam and Dakota, for your responses!

Carol


Adam Goucher

unread,
May 28, 2013, 9:47:35 PM5/28/13
to sau...@googlegroups.com
Does https://github.com/Element-34/Py.Saunter-Examples/tree/master/picpaste/webdriver work for you? It works for me locally and in sauce.

-adam

Carol Mirakove

unread,
May 29, 2013, 3:13:47 PM5/29/13
to sau...@googlegroups.com
Yep, the picpaste example works for me in sauce. The obvious difference between the example and my tests is the explicit setup and teardown methods in the test-script class. I'll work on setup and teardown hooks for my tests. Thanks.

Carol Mirakove

unread,
May 29, 2013, 4:09:29 PM5/29/13
to sau...@googlegroups.com
I further compared the picpaste example with my code and I found that explicit setup and teardown methods are not needed. It is this line in saunter.ini that cause my SauceLabs tests to Error with timeouts:

get_log: true

I set get_log to false and now my tests Pass and Fail as expected. Dakota, when you have a chance, I would be interested to hear whether or not this resolves your timeouts, too.

Thanks again, Adam.

Carol


Adam Goucher

unread,
May 30, 2013, 8:36:00 AM5/30/13
to sau...@googlegroups.com
Can you log a bug on this?

Carol Mirakove

unread,
May 30, 2013, 10:00:46 AM5/30/13
to sau...@googlegroups.com
Yes! I realized after I logged off last night that I neglected to do so.



--
You received this message because you are subscribed to the Google Groups "Saunter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to saunter+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Adam Goucher

unread,
May 30, 2013, 10:02:49 AM5/30/13
to sau...@googlegroups.com
THanks. I'll look at it as part of the great yamlfication that is about to start in the next week or so.
Reply all
Reply to author
Forward
0 new messages