Test for bug #533
PATCH 1/1 Test for bug #533
This patch adds a test that attempts to create and destroy a domain 1025 times. Currently, this causes xm to crash after the 1014th cycle with the following stack trace:
Quoted 9 lines
Traceback (most recent call last):
File "/usr/sbin/xm", line 8, in ?
from xen.xm import main
File "/usr/lib/python/xen/xm/main.py", line 34, in ?
import xen.xend.XendProtocol
File "/usr/lib/python/xen/xend/XendProtocol.py", line 20, in ?
import httplib
File "/usr/lib/python2.4/httplib.py", line 70, in ?
import mimetools
Quoted 8 lines
File "
/usr/lib/python2.4/mimetools.py", line 6, in ?
import tempfile
File "/usr/lib/python2.4/tempfile.py", line 33, in ?
from random import Random as_Random
File "/usr/lib/python2.4/random.py", line 44, in ?
from math import log as_log, exp as_exp, pi as_pi, e as _e
ImportError:/usr/lib/python2.4/lib-dynload/mathmodule.so: cannot open shared object file: Too many open files
Since this test takes a long time to run, I have not enabled it by default, but it should be included in the tree to make bug #533 easily reproducible.
Perhaps xm-test should have a configure option that enables long, exhaustive tests?
# HG changeset patch
# User [email protected]
# Node ID 3e84a0ac070b4c85c81d593b70ee9a23e0c9b2cb
# Parent fcc833cbaf827327ad9e9348c93aaf7f99f0253f
Add a test for ~1000 create/destroy cycles. Currently, this causes xm to crash.
tools/xm-test/tests/create/16_create_massive.py new file +21 -0
@@ -0,0 +1,21 @@ +#!/usr/bin/python + +# Copyright (C) International Business Machines Corp., 2005 +# Author: Dan Smith <[email protected]> + +from XmTestLib import * + +COUNT=1025 + +for i in range(0,COUNT): + print "Creating %i of %i..." % (i, COUNT) + try: + dom = XmTestDomain(name="massive-%i" % i) + dom.start() + console = XmConsole(dom.getName()) + except DomainError, e1: + FAIL("Failed to start domain %i" % i) + except ConsoleError, e2: + FAIL("Failed to attach console to domain %i" % i) + + dom.destroy()
Signature · 4 lines
Dan Smith IBM Linux Technology Center Open Hypervisor Team email: [email protected]
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 3 lines · Dan Smith
This patch adds a test that attempts to create and destroy a domain 1025 times. Currently, this causes xm to crash after the 1014th cycle with the following stack trace:
The test is bogus and so if the bug.
seem you don't close the console fd by calling closeConsole at each loop.
Quoted 1 line
Quoted 1 line
shared object file: Too many open files
that it is basic ulimit behavior (usually 1024 is default configuration)
Quoted 7 lines
tools/xm-test/tests/create/16_create_massive.py new file +7
-0+# Copyright (C) International Business Machines Corp., 2005 +# Author: Dan Smith <[email protected]> + +from XmTestLib import * + +COUNT=1025 +
tools/xm-test/tests/create/16_create_massive.py line 19
Quoted 10 lines
tools/xm-test/tests/create/16_create_massive.py new file +10
-0+for i in range(0,COUNT): + print "Creating %i of %i..." % (i, COUNT) + try: + dom = XmTestDomain(name="massive-%i" % i) + dom.start() + console = XmConsole(dom.getName()) + except DomainError, e1: + FAIL("Failed to start domain %i" % i) + except ConsoleError, e2: + FAIL("Failed to attach console to domain %i" % i)
try to add here:
+ console.closeConsole()
Quoted 1 line
+
dom.destroy()
and report back if it doesn't fix the problem.
[resent: forgot to CC xen-devel]
Signature · 1 line
Vincent Hanquez
VH> The test is bogus and so if the bug. seem you don't close the VH> console fd by calling closeConsole at each loop.
You're right. I think what is happening is that the test exhausts all the fd's and then exec's xm with none free.
I was trying to replicate a situation reported on xen-users, so when I hit this, I filed the bug and sent the test. Turns out, I wasn't even replicating the right situation anyway.
I'll write a test for the /actual/ reported issue and submit that if the behavior is reproducible.
Just ignore me for now ... ;)
Signature · 4 lines
Dan Smith IBM Linux Technology Center Open Hypervisor Team email: [email protected]
Quoted 5 lines · Dan Smith
This patch adds a test that attempts to create and destroy a domain 1025 times. Currently, this causes xm to crash after the 1014th cycle with the following stack trace:
Quoted 1 line
shared object file: Too many open files
Thanks Dan. I'll apply your patch soon. Meanwhile, could you run this test and then send the output of lsof when you're a long way in (but before it crashes). It should be pretty easy to figure out where you're leaking that file descriptor from that.
Quoted 6 lines
Since this test takes a long time to run, I have not enabled it by default, but it should be included in the tree to make bug #533 easily reproducible.
Perhaps xm-test should have a configure option that enables long, exhaustive tests?
I thought we already had two speeds of xm-test. Do you mean add a third? If so, that's fine, and a patch would be welcome!
Ewan.