Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/targets/__tests__/maven.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -808,13 +808,13 @@ describe('closeRepository', () => {
Promise.resolve(getRepositoryInfo('open'))
);

// Deadline is 60min, so we fake pooling start time and initial read to 1min
// and second iteration to something over 60min
// Deadline is 2h, so we fake pooling start time and initial read to 1min
// and second iteration to something over 2h
jest
.spyOn(Date, 'now')
.mockImplementationOnce(() => 1 * 60 * 1000)
.mockImplementationOnce(() => 1 * 60 * 1000)
.mockImplementationOnce(() => 62 * 60 * 1000);
.mockImplementationOnce(() => 122 * 60 * 1000);

await expect(mvnTarget.closeRepository(repositoryId)).rejects.toThrow(
new Error('Deadline for Nexus repository status change reached.')
Expand Down Expand Up @@ -915,13 +915,13 @@ describe('releaseRepository', () => {
deploymentState: 'PUBLISHING'
})

// Deadline is 60min, so we fake pooling start time and initial read to 1min
// and second iteration to something over 60min
// Deadline is 2h, so we fake pooling start time and initial read to 1min
// and second iteration to something over 2h
jest
.spyOn(Date, 'now')
.mockImplementationOnce(() => 1 * 60 * 1000)
.mockImplementationOnce(() => 1 * 60 * 1000)
.mockImplementationOnce(() => 62 * 60 * 1000);
.mockImplementationOnce(() => 122 * 60 * 1000);

await expect(mvnTarget.releaseRepository(repositoryId)).rejects.toThrow(
new Error('Deadline for Central repository status change reached.')
Expand Down
2 changes: 1 addition & 1 deletion src/targets/maven.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const NEXUS_API_BASE_URL =
'https://ossrh-staging-api.central.sonatype.com';
export const CENTRAL_API_BASE_URL = 'https://central.sonatype.com/api/v1';
const NEXUS_RETRY_DELAY = 10 * 1000; // 10s
const SONATYPE_RETRY_DEADLINE = 60 * 60 * 1000; // 60min
const SONATYPE_RETRY_DEADLINE = 120 * 60 * 1000; // 2h
const CENTRAL_RETRY_DELAY = 60 * 1000; // 1min

export type NexusRepository = {
Expand Down
Loading