Skip to content

Commit

Permalink
Merge pull request #276 from snyk-tech-services/fix/reduce-open-handles
Browse files Browse the repository at this point in the history
fix: reduce open file handles in snyk-request-manager
  • Loading branch information
lili2311 authored Feb 1, 2022
2 parents 7762ecd + 6c13210 commit f19e88a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"parse-link-header": "2.0.0",
"sleep-promise": "8.0.1",
"snyk-config": "^4.0.0",
"snyk-request-manager": "1.4.4",
"snyk-request-manager": "1.5.0",
"source-map-support": "^0.5.16",
"split": "1.0.1",
"yargs": "16.2.0"
Expand Down
8 changes: 4 additions & 4 deletions test/lib/source-handlers/github/github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('listGithubOrgs script', () => {
id: expect.any(Number),
url: expect.any(String),
});
}, 20000);
}, 30000);
it('list orgs GHE', async () => {
process.env.GITHUB_TOKEN = process.env.TEST_GHE_TOKEN;
const GHE_URL = process.env.TEST_GHE_URL;
Expand All @@ -24,7 +24,7 @@ describe('listGithubOrgs script', () => {
id: expect.any(Number),
url: expect.any(String),
});
}, 20000);
}, 30000);
});

describe('listGithubRepos script', () => {
Expand All @@ -44,7 +44,7 @@ describe('listGithubRepos script', () => {
branch: expect.any(String),
fork: expect.any(Boolean),
});
}, 20000);
}, 30000);
it('list GHE repos', async () => {
const GITHUB_ORG_NAME = process.env.TEST_GH_ORG_NAME;
const GHE_URL = process.env.TEST_GHE_URL;
Expand All @@ -60,5 +60,5 @@ describe('listGithubRepos script', () => {
branch: expect.any(String),
fork: expect.any(Boolean),
});
}, 20000);
}, 30000);
});
6 changes: 3 additions & 3 deletions test/scripts/generate-org-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('generateOrgImportDataFile Github script', () => {
name: expect.any(String),
groupId,
});
}, 80000);
}, 180000);
it('generate Github Enterprise Orgs data & skips empty Orgs', async () => {
process.env.GITHUB_TOKEN = process.env.TEST_GHE_TOKEN;
const GHE_URL = process.env.TEST_GHE_URL;
Expand All @@ -135,7 +135,7 @@ describe('generateOrgImportDataFile Github script', () => {
name: expect.any(String),
groupId,
});
}, 80000);
}, 180000);
});

describe('generateOrgImportDataFile Gitlab script', () => {
Expand Down Expand Up @@ -170,7 +170,7 @@ describe('generateOrgImportDataFile Gitlab script', () => {
name: expect.any(String),
groupId,
});
}, 80000);
}, 180000);

it('generate Gitlab Orgs data and skips empty orgs', async () => {
process.env.GITLAB_TOKEN = process.env.TEST_GITLAB_TOKEN;
Expand Down
8 changes: 4 additions & 4 deletions test/scripts/generate-targets-data.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('generateTargetsImportDataFile Github script', () => {
integrationId: 'github-********-********-********',
orgId: 'org-id',
});
}, 10000);
}, 30000);

it('generate Github Enterprise repo data', async () => {
process.env.GITHUB_TOKEN = process.env.TEST_GHE_TOKEN;
Expand Down Expand Up @@ -87,7 +87,7 @@ describe('generateTargetsImportDataFile Github script', () => {
integrationId: 'github-enterprise-********-********',
orgId: 'org-id',
});
}, 10000);
}, 30000);

it('generate Github repo data when no integrations are available', async () => {
process.env.GITHUB_TOKEN = process.env.GH_TOKEN;
Expand All @@ -111,7 +111,7 @@ describe('generateTargetsImportDataFile Github script', () => {
).rejects.toThrow(
'No targets could be generated. Check the error output & try again.',
);
}, 10000);
}, 30000);
it('Duplicate orgs are ignored', async () => {
process.env.GITHUB_TOKEN = process.env.GH_TOKEN;
filesToDelete.push(path.resolve(__dirname + '/github-import-targets.json'));
Expand Down Expand Up @@ -159,7 +159,7 @@ describe('generateTargetsImportDataFile Github script', () => {
integrationId: expect.any(String),
orgId: expect.any(String),
});
}, 10000);
}, 30000);
});

describe('generateTargetsImportDataFile Gitlab script', () => {
Expand Down

0 comments on commit f19e88a

Please sign in to comment.