Skip to content

Conversation

@VallariAg
Copy link
Member

@VallariAg VallariAg commented Nov 20, 2024

Testing unit test fix by using teuthology with a new commit: VallariAg/teuthology@b7e20cb.

To understand the cause of problem...
I created a new file test_new:

from fastapi import FastAPI
from fastapi.testclient import TestClient

app = FastAPI()


@app.get("/")
async def read_main():
    return {"msg": "Hello World"}


client = TestClient(app)


def test_read_main():
    response = client.get("/")
    assert response.status_code == 200
    assert response.json() == {"msg": "Hello World"}

and ran pytest tests/test_new.py::test_read_main --full-trace
Then added import teuthology to the file and it starts hanging!

With --full-trace, I get a gevent traceback. Which means teuthology and TestClient are clashing somehow.
I've seen these gevent problems before with teuthology import. Not patching threads in teuthology fixed it.

So testing it again here.

Contribution Guidelines

To sign and test your commits, please refer to Contibution guidelines.

Checklist

Signed-off-by: Vallari Agrawal <val.agl002@gmail.com>
@VallariAg VallariAg closed this Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant