Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pipelines fails to run more than one Multi-threaded/Multi-process test

Max Herman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 23, 2024

Hello,

I have some Python tests. Each test starts 3 separate threads:

1. Runs flask thread on port 500 (source API)
2. Runs Another flask thread on port 501 (destination API)
3. Third thread - starts a Python application (start "python main.py parameters" process), gathers data from source API, and writes to destination API. 

After all 3 started, the test waits for a certain time/events and validates that the destination API received the correct data. 

When I run tests (in any sequence) on my computer Windows, all tests, consistently pass. All ports are closed, and threads are exited. 

If I run any single test on the BB pipeline - it consistently passes.

PROBLEM:  If I run more than 1 test on BB pipeline, the first always passes, and the second - always fails. The fail - is that Destination API never receives the API calls from the main application. However, I do see that the calls are made, and the process acknowledges it. 

Questions: 

1. Is there any problem with closing/shutting down listening on ports from Python? Maybe a delayed port release?

2. Is it possible that more than 1 process listens on the same port in 

image: python:3.10 ?

3. Any other ideas, of how it's possible? 

1 answer

1 accepted

2 votes
Answer accepted
Max Herman
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 23, 2024

OK, figured it out: the failure in cleanup (shutting down sub process on bitbucket BB/Linux).

The 3rd process fails to exit from the first test run.

So when the 2nd test runs, it starts the 2nd "python main.py" process. And the log messages I see that write to destination API - is from the leftover process.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events