mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
fix(bitbucket-server): fix race condition (#3592)
This commit is contained in:
parent
30fd17779e
commit
5306e6bdf2
2 changed files with 5 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
const url = require('url');
|
||||
const delay = require('delay');
|
||||
|
||||
const api = require('./bb-got-wrapper');
|
||||
const utils = require('./utils');
|
||||
|
@ -240,6 +241,8 @@ async function commitFilesToBranch(
|
|||
parentBranch
|
||||
);
|
||||
|
||||
// wait for pr change propagation
|
||||
await delay(1000);
|
||||
// refresh cache
|
||||
await getBranchPr(branchName, true);
|
||||
}
|
||||
|
@ -696,6 +699,7 @@ async function getPr(prNo, refreshCache) {
|
|||
if (!prNo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const res = await api.get(
|
||||
`./rest/api/1.0/projects/${config.projectKey}/repos/${
|
||||
config.repositorySlug
|
||||
|
|
|
@ -13,6 +13,7 @@ describe('platform/bitbucket-server', () => {
|
|||
beforeEach(() => {
|
||||
// reset module
|
||||
jest.resetModules();
|
||||
jest.mock('delay');
|
||||
jest.mock('got', () => (url, options) => {
|
||||
const { method } = options;
|
||||
const body = mockResponses[url] && mockResponses[url][method];
|
||||
|
|
Loading…
Reference in a new issue