bitbucket pipeline IndexOutOfBounds Index: 0, Size: 0 error

Meagan March 24, 2023

In our pipeline we run our Java unit tests. 

During some of the unit tests:

-  we request something from the db or a third party and it fills the array.

-  we know these requests are successful (the third party tool shows received and sent request, so I have confirmed its requesting the information and it's sent back).

But it seems like bitbucket tries to move on too quickly before the variable is actually set and it throws this error. But only sometimes. I re-run the pipeline and it's fine. But 1/5 times it fails with this error. 

What are ways to fix this? Caching? Sleeps? Have it auto re-run once if it fails (I'd rather not since this seems like a hack)?

1 answer

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 30, 2023

Hi @Meagan Hiatt,

Thank you for reaching out to the community.

It seems to me that you'd need to put in some buffer time so that it will not move on too quickly.
Have you tried putting some sleep command there?

Regards,
Mark C

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events