I've been having trouble running the tests lately, because test_pwd is really slow. It's a fairly trivial set of tests -- checking the types of return values and cross-checking getpwall() vs. getpwnam()/getpwuid(). The problem is if your password database is provided by LDAP and is really big, the test takes an impractically long time. Would anyone object if I changed the test suite to require some resource to run test_pwd? Or should I just make some local change to disable it? Jeremy
On Mon, 2004-07-12 at 08:37, Jeremy Hylton wrote:
Would anyone object if I changed the test suite to require some resource to run test_pwd? Or should I just make some local change to disable it?
Is there some generic/dynamic way to test whether you're pwd is using LDAP or not? If there is, a more generic resource switch that isn't specific to pwd would be better (e.g. what about grp or other databases?). -Barry
I've been having trouble running the tests lately, because test_pwd is really slow. It's a fairly trivial set of tests -- checking the types of return values and cross-checking getpwall() vs. getpwnam()/getpwuid(). The problem is if your password database is provided by LDAP and is really big, the test takes an impractically long time.
Would anyone object if I changed the test suite to require some resource to run test_pwd? Or should I just make some local change to disable it?
How about instead limiting the number of entries checked to the first 100? Try changing entries = pwd.getpwall() into entries = pwd.getpwall()[:100] --Guido van Rossum (home page: http://www.python.org/~guido/)
Guido van Rossum wrote:
I've been having trouble running the tests lately, because test_pwd is really slow. It's a fairly trivial set of tests -- checking the types of return values and cross-checking getpwall() vs. getpwnam()/getpwuid(). The problem is if your password database is provided by LDAP and is really big, the test takes an impractically long time.
Would anyone object if I changed the test suite to require some resource to run test_pwd? Or should I just make some local change to disable it?
How about instead limiting the number of entries checked to the first 100? Try changing
entries = pwd.getpwall()
into
entries = pwd.getpwall()[:100]
If the bottleneck is in the n calls to pwd.getpwnam() and pwd.getpwuid() limiting n is an option. If the bottleneck is the one call to pwd.getpwall() adding a resource requirement might be the only option. Bye, Walter Dörwald
On Tue, 13 Jul 2004 11:26:25 +0200, Walter Dörwald <walter@livinglogic.de> wrote:
If the bottleneck is in the n calls to pwd.getpwnam() and pwd.getpwuid() limiting n is an option. If the bottleneck is the one call to pwd.getpwall() adding a resource requirement might be the only option.
I'll investigate and see which it is. Jeremy
participants (4)
-
Barry Warsaw
-
Guido van Rossum
-
Jeremy Hylton
-
Walter Dörwald