Skip to content

Get Exception socket.error: error(9, 'Bad file descriptor') in testing. #16

@markduan

Description

@markduan

Hello, INADA:
I write a class inherits pools.Pool names DBServer, and it is a singleton class. I also write a class DBServerTestCase that inherit AsyncTestCase.
This is part of DBServerTestCase:

class DBServerTestCase(AsyncTestCase):
    def setUp(self):
        super(DBServerTestCase, self).setUp()
        self.db = DBServer(dict(host='127.0.0.1', port=3306, user='root', passwd='root', db='mydatabase', cursorclass=DictCursor),
            max_idle_connections=2,
            max_recycle_sec=3,
            max_open_connections=5)

...Many test methods...

When I run this test case, I get many errors like:

Exception socket.error: error(9, 'Bad file descriptor') in <bound method Connection.__del__ of <tornado_mysql.connections.Connection object at 0x106753ed0>> ignored

I don't override tearDown method.
If I just run one method, everything is fine, no error.
Is it appropriate that writing setUp method like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions