Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sporadic test failures for test_issue_36 #714

Open
Nothing4You opened this issue Jan 30, 2022 · 1 comment
Open

Fix sporadic test failures for test_issue_36 #714

Nothing4You opened this issue Jan 30, 2022 · 1 comment
Labels

Comments

@Nothing4You
Copy link
Collaborator

see e.g. https://github.com/aio-libs/aiomysql/runs/4995767021?check_suite_focus=true

restarting the CI job fixes the test run, something is not consistent there.

@Nothing4You
Copy link
Collaborator Author

additional context, as CI logs are volatile:

=================================== FAILURES ===================================
_____________________ test_issue_36[asyncio-tcp-mysql8.0] ______________________

connection_creator = <function connection_creator.<locals>.f at 0x7eff31f0cee0>

    @pytest.mark.run_loop
    async def test_issue_36(connection_creator):
        conn = await connection_creator()
        c = await conn.cursor()
        # kill connections[0]
        await c.execute("show processlist")
        kill_id = None
        rows = await c.fetchall()
        for row in rows:
            id = row[0]
            info = row[7]
            if info == "show processlist":
                kill_id = id
                break
        try:
            # now nuke the connection
            await conn.kill(kill_id)
            # make sure this connection has broken
            await c.execute("show tables")
            pytest.fail()
        except Exception:
            pass
    
        # check the process list from the other connection
        conn2 = await connection_creator()
        c = await conn2.cursor()
        await c.execute("show processlist")
        rows = await c.fetchall()
        ids = [row[0] for row in rows]
    
>       assert kill_id not in ids
E       assert 1018 not in [5, 1018, 1019]

tests/test_issues.py:258: AssertionError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant