Skip to content

Commit

Permalink
Remove timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Or-Geva committed Nov 15, 2023
1 parent 0080e5d commit 695a5c0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/main/scanLogic/scanRunners/analyzerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export class AnalyzerManager {
AnalyzerManager.BINARY_NAME
);
private static readonly JFROG_RELEASES_URL: string = 'https://releases.jfrog.io';
public static readonly TIMEOUT_MILLISECS: number = 1000 * 60 * 5;
public static readonly ENV_PLATFORM_URL: string = 'JF_PLATFORM_URL';
public static readonly ENV_TOKEN: string = 'JF_TOKEN';
public static readonly ENV_USER: string = 'JF_USER';
Expand Down
10 changes: 2 additions & 8 deletions src/main/utils/scanUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class ScanUtils {
logger.logMessage(error.message, 'DEBUG');
return undefined;
}
if (handle || error instanceof ScanTimeoutError) {
if (handle) {
logger.logError(error, true);
return undefined;
}
Expand Down Expand Up @@ -300,10 +300,4 @@ export class FileScanError extends Error {

export class ScanCancellationError extends Error {
message: string = 'Scan was cancelled';
}

export class ScanTimeoutError extends Error {
constructor(scan: string, public time_millisecs: number) {
super(`Task ${scan} timed out after ${time_millisecs}ms`);
}
}
}
7 changes: 0 additions & 7 deletions src/test/tests/scanAnlayzerRunner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { LogManager } from '../../main/log/logManager';
import { AnalyzeScanRequest, AnalyzerScanRun, ScanType } from '../../main/scanLogic/scanRunners/analyzerModels';
import { JasRunner } from '../../main/scanLogic/scanRunners/jasRunner';
import { AppsConfigModule } from '../../main/utils/jfrogAppsConfig/jfrogAppsConfig';
import { RunUtils } from '../../main/utils/runUtils';
import { NotEntitledError, ScanCancellationError, ScanUtils } from '../../main/utils/scanUtils';
import { Translators } from '../../main/utils/translators';
import { AnalyzerManager } from '../../main/scanLogic/scanRunners/analyzerManager';
Expand Down Expand Up @@ -196,29 +195,25 @@ describe('Analyzer BinaryRunner tests', async () => {
[
{
name: 'Run valid request',
timeout: AnalyzerManager.TIMEOUT_MILLISECS,
createDummyResponse: true,
shouldAbort: false,
expectedErr: undefined
},
{
name: 'Not entitled',
timeout: AnalyzerManager.TIMEOUT_MILLISECS,
createDummyResponse: true,
shouldAbort: false,
expectedErr: new NotEntitledError()
},
{
name: 'Cancel requested',
timeout: AnalyzerManager.TIMEOUT_MILLISECS,
createDummyResponse: true,
shouldAbort: true,
expectedErr: new ScanCancellationError()
},

{
name: 'Response not created',
timeout: AnalyzerManager.TIMEOUT_MILLISECS,
createDummyResponse: false,
shouldAbort: false,
expectedErr: new Error(
Expand All @@ -236,8 +231,6 @@ describe('Analyzer BinaryRunner tests', async () => {
throw new ScanCancellationError();
} else if (test.name === 'Not entitled') {
throw new DummyRunnerError();
} else if (test.name === 'Timeout') {
await RunUtils.delay(AnalyzerManager.TIMEOUT_MILLISECS);
}
if (test.createDummyResponse) {
fs.writeFileSync(responsePath, JSON.stringify({} as AnalyzerScanRun));
Expand Down

0 comments on commit 695a5c0

Please sign in to comment.