Skip to content

Commit

Permalink
fix: Remove multiplication of this.#timeout by 1000 (#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliclark committed Jun 1, 2021
1 parent 3178501 commit b320b18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/lambda/__tests__/LambdaFunction.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ describe('LambdaFunction', () => {
expect(second).toBeGreaterThan(third - 200)
})

// might run flaky (unreliable)
test('should use default lambda timeout when timeout is not provided', async () => {
const functionDefinition = {
handler: 'fixtures/lambdaFunction.fixture.defaultTimeoutHandler',
Expand All @@ -156,9 +155,11 @@ describe('LambdaFunction', () => {
)
const remainingTime = await lambdaFunction.runHandler()

expect(remainingTime).toBeLessThan(DEFAULT_LAMBDA_TIMEOUT * 1000)

// result might be flaky/unreliable:
// (assmuning handler runs no longer than 100 ms)
expect(DEFAULT_LAMBDA_TIMEOUT * 1000).toBeLessThanOrEqual(remainingTime)
// (assmuning handler runs no longer than 1 s)
expect(remainingTime + 1000).toBeGreaterThan(DEFAULT_LAMBDA_TIMEOUT * 1000)
})

// // might run flaky (unreliable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export default class InProcessRunner {
}
})

const executionTimeout = performance.now() + this.#timeout * 1000
const executionTimeout = performance.now() + this.#timeout

// attach doc-deprecated functions
// create new immutable object
Expand Down

0 comments on commit b320b18

Please sign in to comment.