Skip to content

Commit

Permalink
Fix failing Azure tests (#19877)
Browse files Browse the repository at this point in the history
Noticed Azure tests have started failing after #19758 due to the middleware taking longer than the allotted threshold which adds unexpected logs to stderr. This attempts to resolve these test failures by increasing the allotted time for the middleware when running on Azure. 

x-ref: https://dev.azure.com/nextjs/next.js/_build/results?buildId=22617&view=logs&jobId=5ee44de4-e310-59d9-0ba5-4a271a649fb0&j=5ee44de4-e310-59d9-0ba5-4a271a649fb0&t=af3fb693-3771-5a1a-ec97-2ba4cc77f25c
x-ref: https://dev.azure.com/nextjs/next.js/_build/results?buildId=22619&view=logs&jobId=5ee44de4-e310-59d9-0ba5-4a271a649fb0&j=5ee44de4-e310-59d9-0ba5-4a271a649fb0&t=af3fb693-3771-5a1a-ec97-2ba4cc77f25c
  • Loading branch information
ijjk authored Dec 8, 2020
1 parent f186be6 commit cf46655
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/next/next-server/lib/post-process.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { parse, HTMLElement } from 'node-html-parser'
import { OPTIMIZED_FONT_PROVIDERS } from './constants'

const MIDDLEWARE_TIME_BUDGET = 10
const MIDDLEWARE_TIME_BUDGET =
parseInt(process.env.__POST_PROCESS_MIDDLEWARE_TIME_BUDGET || '', 10) || 10
const MAXIMUM_IMAGE_PRELOADS = 2
const IMAGE_PRELOAD_SIZE_THRESHOLD = 2500

Expand Down
1 change: 1 addition & 0 deletions run-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ const configuredTestTypes = [UNIT_TEST_EXT]
...(isAzure
? {
HEADLESS: 'true',
__POST_PROCESS_MIDDLEWARE_TIME_BUDGET: '50',
}
: {}),
...(usePolling
Expand Down

0 comments on commit cf46655

Please sign in to comment.