Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Python3.8 time.sleep() fails on unit test


Hi there, I'm using python:3.8 image and trying to run unit test with pytest.

When time.sleep() method is called in order to retry http connection, the step abruptly stops without any error and log.

How can I debug or resolve this? Thanks


Pytest command

pipenv run pytest --capture=tee-sys



with socket.create_connection((host, port), timeout=timeout):"port={port} is ready")
except OSError as ex:
try:"Performing an action which may throw an exception.")
except:"Everything looks great!")
"Finally is called directly after executing the try statement whether an exception is thrown or not.")



Output on the pipeline console:

Screen Shot 2021-02-12 at 3.19.50 PM.png

1 answer

Hey @Hiro Nakamata , welcome to the Atlassian community.

Can you make pytest to be more verbose with the output and to do all logging on standard output and error? This should normally reveal more.

In general it means that an error occurred. 

You can debug your pipeline locally, please see: Debug pipelines locally with Docker and the other documents in that section.

Running the pipeline locally is great for debugging, some tooling like bbrun or pipelines exist.

@ktomk thanks for the reply. I added source code and logs

I would run this locally inside a container and then see if it is reproducible.

And if I may ask, why may 


 throw an exception?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,439 views 4 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you