[twill] twill with threads

Barry Hart barry.hart at predictix.com
Thu Dec 18 04:27:11 PST 2008


We've been using Twill recently to do volume testing of a web site. Each
simulated user is a separate CPython process running Twill. The processes
are lightweight enough that a single ordinary PC with 2GB of RAM can
easily simulate dozens of users.

Barry

-----Original Message-----
From: twill-bounces at lists.idyll.org [mailto:twill-bounces at lists.idyll.org]
On Behalf Of C. Titus Brown
Sent: Thursday, December 18, 2008 12:04 AM
To: Macarse
Cc: twill at lists.idyll.org
Subject: Re: [twill] twill with threads

On Tue, Dec 16, 2008 at 05:36:28PM -0200, Macarse wrote:
-> Hi, I am doing a script that:
-> - Gets a list of ips
-> - Sets a threadpool
-> - With twill it logins to the http
-> - with urlib2 gets some html

Hi,

->         #login
->         go(ip + '/login.asp')
->         fv('1', 'user', 'user')
->         fv('1', 'password', 'password')
->         submit('3')
-> 
->         req = urllib2.Request(ip + '/status.asp')
->         response = urllib2.urlopen(req)
->         statusPage = response.read()

You could do this with twill easily enough -- just do

   browser = twill.commands.browser
   statusPage = browser.get_html()

-> my question is: Is ok to use twill like that?
-> Is it thread safe?

...however, unfortunately, the commands interface in twill is not thread
safe, and mechanize (which twill uses to actually do anything :) may
also not be threadsafe.

best,
--titus
-- 
C. Titus Brown, ctb at msu.edu

_______________________________________________
twill mailing list
twill at lists.idyll.org
http://lists.idyll.org/listinfo/twill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/twill/attachments/20081218/c811679c/attachment.html 


More information about the twill mailing list