Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Refactor NodeWritablePiper to Stream #33164

Closed
wants to merge 1 commit into from

Conversation

devknoll
Copy link
Contributor

WIP

@ijjk ijjk added created-by: Chrome Aurora PRs by the Google Chrome team: https://web.dev/aurora type: next labels Jan 10, 2022
@ijjk
Copy link
Member

ijjk commented Jan 10, 2022

Failing test suites

Commit: 9c576b2

test/integration/with-electron/test/index.test.js

  • Parse Relative Url > File Protocol via Electron > app init
  • Parse Relative Url > File Protocol via Electron > should render the home page
  • Parse Relative Url > File Protocol via Electron > should do navigations via Link
  • Parse Relative Url > File Protocol via Electron > should do back to home page via Link
  • Parse Relative Url > File Protocol via Electron > should do navigations via Router
Expand output

● Parse Relative Url › File Protocol via Electron › app init

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  11 | if (process.env.TEST_ELECTRON) {
  12 |   const electron = require(join(nextdir, 'node_modules/electron'))
> 13 |   const { Application } = require(join(nextdir, 'node_modules/spectron'))
     |             ^
  14 |
  15 |   describe('Parse Relative Url', () => {
  16 |     describe('File Protocol via Electron', () => {

  at integration/with-electron/test/index.test.js:13:13
  at integration/with-electron/test/index.test.js:12:9
  at Object.<anonymous> (integration/with-electron/test/index.test.js:11:5)

● Parse Relative Url › File Protocol via Electron › should render the home page

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  11 | if (process.env.TEST_ELECTRON) {
  12 |   const electron = require(join(nextdir, 'node_modules/electron'))
> 13 |   const { Application } = require(join(nextdir, 'node_modules/spectron'))
     |             ^
  14 |
  15 |   describe('Parse Relative Url', () => {
  16 |     describe('File Protocol via Electron', () => {

  at integration/with-electron/test/index.test.js:13:13
  at integration/with-electron/test/index.test.js:12:9
  at Object.<anonymous> (integration/with-electron/test/index.test.js:11:5)

● Parse Relative Url › File Protocol via Electron › should do navigations via Link

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  11 | if (process.env.TEST_ELECTRON) {
  12 |   const electron = require(join(nextdir, 'node_modules/electron'))
> 13 |   const { Application } = require(join(nextdir, 'node_modules/spectron'))
     |             ^
  14 |
  15 |   describe('Parse Relative Url', () => {
  16 |     describe('File Protocol via Electron', () => {

  at integration/with-electron/test/index.test.js:13:13
  at integration/with-electron/test/index.test.js:12:9
  at Object.<anonymous> (integration/with-electron/test/index.test.js:11:5)

● Parse Relative Url › File Protocol via Electron › should do back to home page via Link

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  11 | if (process.env.TEST_ELECTRON) {
  12 |   const electron = require(join(nextdir, 'node_modules/electron'))
> 13 |   const { Application } = require(join(nextdir, 'node_modules/spectron'))
     |             ^
  14 |
  15 |   describe('Parse Relative Url', () => {
  16 |     describe('File Protocol via Electron', () => {

  at integration/with-electron/test/index.test.js:13:13
  at integration/with-electron/test/index.test.js:12:9
  at Object.<anonymous> (integration/with-electron/test/index.test.js:11:5)

● Parse Relative Url › File Protocol via Electron › should do navigations via Router

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  11 | if (process.env.TEST_ELECTRON) {
  12 |   const electron = require(join(nextdir, 'node_modules/electron'))
> 13 |   const { Application } = require(join(nextdir, 'node_modules/spectron'))
     |             ^
  14 |
  15 |   describe('Parse Relative Url', () => {
  16 |     describe('File Protocol via Electron', () => {

  at integration/with-electron/test/index.test.js:13:13
  at integration/with-electron/test/index.test.js:12:9
  at Object.<anonymous> (integration/with-electron/test/index.test.js:11:5)

test/development/acceptance/ReactRefresh.test.ts

  • ReactRefresh > can edit a component without losing state
  • ReactRefresh > cyclic dependencies
Expand output

● ReactRefresh › can edit a component without losing state

page.goto: Timeout 30000ms exceeded.
=========================== logs ===========================
navigating to "http://localhost:32961/", waiting until "load"
============================================================

  103 |         if (tracePlaywright) {
  104 |           if (!frame.payload.includes('pong')) {
> 105 |             page
      |                 ^
  106 |               .evaluate(`console.log('received ws message ${frame.payload}')`)
  107 |               .catch(() => {})
  108 |           }

  at Playwright.loadPage (lib/browsers/playwright.ts:105:20)
  at Object.webdriver [as default] (lib/next-webdriver.ts:59:5)
  at Object.sandbox (development/acceptance/helpers.ts:26:21)
  at Object.<anonymous> (development/acceptance/ReactRefresh.test.ts:15:40)

● ReactRefresh › cyclic dependencies

page.goto: Timeout 30000ms exceeded.
=========================== logs ===========================
navigating to "http://localhost:34247/", waiting until "load"
============================================================

  103 |         if (tracePlaywright) {
  104 |           if (!frame.payload.includes('pong')) {
> 105 |             page
      |                 ^
  106 |               .evaluate(`console.log('received ws message ${frame.payload}')`)
  107 |               .catch(() => {})
  108 |           }

  at Playwright.loadPage (lib/browsers/playwright.ts:105:20)
  at Object.webdriver [as default] (lib/next-webdriver.ts:59:5)
  at Object.sandbox (development/acceptance/helpers.ts:26:21)
  at Object.<anonymous> (development/acceptance/ReactRefresh.test.ts:57:40)

test/integration/amphtml-fragment-style/test/index.test.js

  • AMP Fragment Styles > adds styles from fragment in AMP mode correctly
Expand output

● AMP Fragment Styles › adds styles from fragment in AMP mode correctly

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  14 | const appDir = join(__dirname, '../')
  15 | let appPort
> 16 | let server
     |     ^
  17 | let app
  18 |
  19 | describe('AMP Fragment Styles', () => {

  at integration/amphtml-fragment-style/test/index.test.js:16:5
  at Object.<anonymous> (integration/amphtml-fragment-style/test/index.test.js:15:1)

● Test suite failed to run

TypeError: Cannot read property '__app' of undefined

  409 |   return new Promise((resolve, reject) => {
  410 |     const newArgs = [
> 411 |       ...args,
      |               ^
  412 |       function (err, res) {
  413 |         if (err) return reject(err)
  414 |         resolve(res)

  at Object.stopApp (lib/next-test-utils.js:411:16)
  at integration/amphtml-fragment-style/test/index.test.js:26:38

test/integration/absolute-assetprefix/test/index.test.js

  • absolute assetPrefix with path prefix > should not fetch static data from a CDN
  • absolute assetPrefix with path prefix > should fetch from cache correctly
  • absolute assetPrefix with path prefix > should work with getStaticPaths prerendered
  • absolute assetPrefix with path prefix > should work with getStaticPaths fallback
  • absolute assetPrefix with path prefix > should work with getServerSideProps
Expand output

● absolute assetPrefix with path prefix › should not fetch static data from a CDN

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  40 |           ] = `http://localhost:${appPort}`
  41 |           clientRes.writeHead(proxyRes.statusCode, proxyRes.headers)
> 42 |           proxyRes.pipe(clientRes, { end: true })
     |     ^
  43 |         }
  44 |       )
  45 |

  at integration/absolute-assetprefix/test/index.test.js:42:5
  at Object.<anonymous> (integration/absolute-assetprefix/test/index.test.js:41:1)

● absolute assetPrefix with path prefix › should fetch from cache correctly

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  40 |           ] = `http://localhost:${appPort}`
  41 |           clientRes.writeHead(proxyRes.statusCode, proxyRes.headers)
> 42 |           proxyRes.pipe(clientRes, { end: true })
     |     ^
  43 |         }
  44 |       )
  45 |

  at integration/absolute-assetprefix/test/index.test.js:42:5
  at Object.<anonymous> (integration/absolute-assetprefix/test/index.test.js:41:1)

● absolute assetPrefix with path prefix › should work with getStaticPaths prerendered

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  40 |           ] = `http://localhost:${appPort}`
  41 |           clientRes.writeHead(proxyRes.statusCode, proxyRes.headers)
> 42 |           proxyRes.pipe(clientRes, { end: true })
     |     ^
  43 |         }
  44 |       )
  45 |

  at integration/absolute-assetprefix/test/index.test.js:42:5
  at Object.<anonymous> (integration/absolute-assetprefix/test/index.test.js:41:1)

● absolute assetPrefix with path prefix › should work with getStaticPaths fallback

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  40 |           ] = `http://localhost:${appPort}`
  41 |           clientRes.writeHead(proxyRes.statusCode, proxyRes.headers)
> 42 |           proxyRes.pipe(clientRes, { end: true })
     |     ^
  43 |         }
  44 |       )
  45 |

  at integration/absolute-assetprefix/test/index.test.js:42:5
  at Object.<anonymous> (integration/absolute-assetprefix/test/index.test.js:41:1)

● absolute assetPrefix with path prefix › should work with getServerSideProps

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  40 |           ] = `http://localhost:${appPort}`
  41 |           clientRes.writeHead(proxyRes.statusCode, proxyRes.headers)
> 42 |           proxyRes.pipe(clientRes, { end: true })
     |     ^
  43 |         }
  44 |       )
  45 |

  at integration/absolute-assetprefix/test/index.test.js:42:5
  at Object.<anonymous> (integration/absolute-assetprefix/test/index.test.js:41:1)

● Test suite failed to run

TypeError: Cannot read property 'pid' of undefined

  392 |   await app.prepare()
  393 |   const handler = app.getRequestHandler()
> 394 |   const server = http.createServer(handler)
      |                                ^
  395 |   server.__app = app
  396 |
  397 |   await promiseCall(server, 'listen')

  at Object.killApp (lib/next-test-utils.js:394:32)
  at integration/absolute-assetprefix/test/index.test.js:77:38

test/production/dependencies-can-use-env-vars-in-middlewares/index.test.ts

  • dependencies can use env vars in middlewares > parses the env vars correctly
  • dependencies can use env vars in middlewares > uses the environment variables
Expand output

● dependencies can use env vars in middlewares › parses the env vars correctly

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  15 |   beforeAll(async () => {
  16 |     next = await createNext({
> 17 |       files: {
     |     ^
  18 |         // A 3rd party dependency
  19 |         'node_modules/my-custom-package/package.json': JSON.stringify({
  20 |           name: 'my-custom-package',

  at production/dependencies-can-use-env-vars-in-middlewares/index.test.ts:17:5
  at Object.<anonymous> (production/dependencies-can-use-env-vars-in-middlewares/index.test.ts:11:1)

● dependencies can use env vars in middlewares › uses the environment variables

thrown: "Exceeded timeout of 90000 ms for a hook.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  15 |   beforeAll(async () => {
  16 |     next = await createNext({
> 17 |       files: {
     |     ^
  18 |         // A 3rd party dependency
  19 |         'node_modules/my-custom-package/package.json': JSON.stringify({
  20 |           name: 'my-custom-package',

  at production/dependencies-can-use-env-vars-in-middlewares/index.test.ts:17:5
  at Object.<anonymous> (production/dependencies-can-use-env-vars-in-middlewares/index.test.ts:11:1)

● Test suite failed to run

TypeError: Cannot read property 'destroy' of undefined

  46 |   })
  47 |   afterAll(() => next.destroy())
> 48 |
     | ^
  49 |   it('parses the env vars correctly', async () => {
  50 |     const testDir = next.testDir
  51 |     const manifestPath = path.join(

  at production/dependencies-can-use-env-vars-in-middlewares/index.test.ts:48:23

● Test suite failed to run

next instance not destroyed before exiting, make sure to call .destroy() after the tests after finished

  65 | export class FileRef {
  66 |   public fsPath: string
> 67 |
     | ^
  68 |   constructor(path: string) {
  69 |     this.fsPath = path
  70 |   }

  at lib/e2e-utils.ts:67:19

test/integration/amphtml-custom-optimizer/test/index.test.js

  • AMP Custom Optimizer > should build and start for static page
  • AMP Custom Optimizer > should build and start for dynamic page
Expand output

● AMP Custom Optimizer › should build and start for static page

thrown: "Exceeded timeout of 90000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

   6 |   findPort,
   7 |   nextStart,
>  8 |   killApp,
     |     ^
   9 |   renderViaHTTP,
  10 | } from 'next-test-utils'
  11 |

  at integration/amphtml-custom-optimizer/test/index.test.js:8:5
  at Object.<anonymous> (integration/amphtml-custom-optimizer/test/index.test.js:7:1)

● AMP Custom Optimizer › should build and start for dynamic page

thrown: "Exceeded timeout of 90000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  17 |   it('should build and start for static page', async () => {
  18 |     const { code } = await nextBuild(appDir, undefined)
> 19 |     expect(code).toBe(0)
     |     ^
  20 |
  21 |     appPort = await findPort()
  22 |     app = await nextStart(appDir, appPort)

  at integration/amphtml-custom-optimizer/test/index.test.js:19:5
  at Object.<anonymous> (integration/amphtml-custom-optimizer/test/index.test.js:7:1)

test/integration/amphtml-custom-validator/test/index.test.js

  • AMP Custom Validator > should build and start successfully
  • AMP Custom Validator > should run in dev mode successfully
Expand output

● AMP Custom Validator › should build and start successfully

thrown: "Exceeded timeout of 90000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

   6 |   findPort,
   7 |   nextStart,
>  8 |   killApp,
     |     ^
   9 |   launchApp,
  10 |   renderViaHTTP,
  11 | } from 'next-test-utils'

  at integration/amphtml-custom-validator/test/index.test.js:8:5
  at Object.<anonymous> (integration/amphtml-custom-validator/test/index.test.js:7:1)

● AMP Custom Validator › should run in dev mode successfully

thrown: "Exceeded timeout of 90000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  15 | const appDir = join(__dirname, '../')
  16 |
> 17 | describe('AMP Custom Validator', () => {
     |     ^
  18 |   it('should build and start successfully', async () => {
  19 |     const { code } = await nextBuild(appDir)
  20 |     expect(code).toBe(0)

  at integration/amphtml-custom-validator/test/index.test.js:17:5
  at Object.<anonymous> (integration/amphtml-custom-validator/test/index.test.js:7:1)

test/integration/clean-distdir/test/index.test.js

  • Cleaning distDir > disabled write > should not clean up .next before build start
  • Cleaning distDir > server mode > should clean up .next before build start
  • Cleaning distDir > serverless mode > should clean up .next before build start
Expand output

● Cleaning distDir › server mode › should clean up .next before build start

thrown: "Exceeded timeout of 90000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  22 |
  23 | const runTests = () => {
> 24 |   it('should clean up .next before build start', async () => {
     |     ^
  25 |     await checkFileWrite(false)
  26 |   })
  27 | }

  at runTests (integration/clean-distdir/test/index.test.js:24:5)
  at integration/clean-distdir/test/index.test.js:30:9
  at integration/clean-distdir/test/index.test.js:29:5
  at Object.<anonymous> (integration/clean-distdir/test/index.test.js:28:1)

● Cleaning distDir › serverless mode › should clean up .next before build start

thrown: "Exceeded timeout of 90000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  22 |
  23 | const runTests = () => {
> 24 |   it('should clean up .next before build start', async () => {
     |     ^
  25 |     await checkFileWrite(false)
  26 |   })
  27 | }

  at runTests (integration/clean-distdir/test/index.test.js:24:5)
  at integration/clean-distdir/test/index.test.js:44:9
  at integration/clean-distdir/test/index.test.js:32:5
  at Object.<anonymous> (integration/clean-distdir/test/index.test.js:28:1)

● Cleaning distDir › disabled write › should not clean up .next before build start

thrown: "Exceeded timeout of 90000 ms for a test.
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

  56 |       await fs.writeFile(
  57 |         nextConfig,
> 58 |         `
     |         ^
  59 |         module.exports = {
  60 |           cleanDistDir: false
  61 |         }

  at integration/clean-distdir/test/index.test.js:58:9
  at integration/clean-distdir/test/index.test.js:46:5
  at Object.<anonymous> (integration/clean-distdir/test/index.test.js:28:1)

@devknoll devknoll closed this Mar 8, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
created-by: Chrome Aurora PRs by the Google Chrome team: https://web.dev/aurora type: next
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants