tiktok / tiktok-business-api-sdk

An SDK built to facilitate application development to integrate with TikTok Business API.
https://ads.tiktok.com/marketing_api/docs?id=1764231376750658&rid=542rk6sm9jl
MIT License
69 stars 26 forks source link

Pytest Race Condition with ApiClient #14

Closed HossameldeinDev closed 8 months ago

HossameldeinDev commented 9 months ago

I get this timeout issue inconsistently when running my test cases. The issue comes from the ApiClient class -> "del" destructor when it waits forever.

Screenshot 2023-10-06 at 2 20 38 AM

I'm not using the async calls from the library, I had to set this element to None to override the initialisation of the thread to make it work

# Set the pool to None to avoid the threa lock issue as we are not using threads anyway
        self.api_client.pool = None
jasonchentt commented 8 months ago

Thanks for your reporting! We may update our docs to avoid future users meeting the same issue! You could continue to use "self.api_client.pool = None" to address it for now.