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

Random failure of playwright test due to timeout, if execution is done via bitbucket pipeline

rupam25
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!
November 29, 2024

 

I am running my playwright on edge,chrome,safari & firefox browsers using bitbucket pipeline. Some tests are randomly failing due to timeout sometimes on fiefox or chrome even though sufficient wait is available.Once n several attempt, all tests are green as well. Locally also it works fine. Below is the code for waituntil function.

async waitUntil(func, timeout = 1000, pollingRate = 100) {
return new Promise((resolve, reject) => {
const timer = setTimeout(() => {
clearInterval(interval);
reject(new Error('WaitUntil timed out'));
}, timeout);
const interval = setInterval(() => {
if (!func())
return;

clearTimeout(timer);
clearInterval(interval);
resolve();
}, pollingRate);
});
}

Screenshot 2024-11-29 at 15.44.13.pngCan anyone suggest something how the test can be stabilized in this case?

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 2, 2024

Hi and welcome to the community!

I suggest running this without Pipelines to confirm if you see the same behavior.

 

If this Pipelines build runs on Atlassian's infrastructure or with a self-hosted Linux Docker runner

You can use the following guide to troubleshoot locally in an environment as close as possible to the Pipelines one:

 

If this Pipelines build runs with a Linux Shell, MacOS or Windows self-hosted runner

Linux Shell and MacOS runners use bash to run builds directly on the host machine. Windows runners use PowerShell to do the same. If this build uses any of these types of runners, you can use bash or PowerShell (depeending on the type of runner) to:

  • clone the repo on the runner's host machine
  • switch to the clone directory and do a git reset to the commit of the failed build
  • run one by one the commands of the build that you have in your bitbucket-pipelines.yml file.

 

You can also try temporarily increasing the time out you have set to see if that resolves the issue, or adding logging that shows how much time has lapsed.

Kind regards,
Theodora

Suggest an answer

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

Atlassian Community Events