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

chore: Migrate css-*.test.js to node:test #10059

Closed
wants to merge 10 commits into from
Closed

Conversation

xMohamd
Copy link
Contributor

@xMohamd xMohamd commented Feb 8, 2024

Changes

Testing

All tests pass.

Docs

N/A

Copy link

changeset-bot bot commented Feb 8, 2024

⚠️ No Changeset found

Latest commit: 2937d53

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Feb 8, 2024
@xMohamd
Copy link
Contributor Author

xMohamd commented Feb 9, 2024

According to actions the error in static-build-frameworks.nodetest.js, I tried to figure out what an error was, but I couldn't
@mingjunlu can you help? #10047

✖ failing tests:

test at file:/workspaces/astro/packages/astro/test/static-build-frameworks.nodetest.js:20:2
✖ can build preact
  'test did not finish before its parent and was cancelled'

test at file:/workspaces/astro/packages/astro/test/static-build-frameworks.nodetest.js:25:2
✖ can build react
  'test did not finish before its parent and was cancelled'

test at file:/workspaces/astro/packages/astro/test/static-build-frameworks.nodetest.js:32:5
﹣ can build lit # SKIP
  'test did not finish before its parent and was cancelled'

test at file:/workspaces/astro/packages/astro/test/static-build-frameworks.nodetest.js:37:2
✖ can build nested framework usage
  'test did not finish before its parent and was cancelled'

test at file:/workspaces/astro/packages/astro/test/static-build-frameworks.nodetest.js:6:1
✖ Static build - frameworks (4982.706418ms)
  TypeError [Error]: Cannot read properties of undefined (reading 'getCurrentStack')
      at performWork (/workspaces/astro/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:6567:56)
      at /workspaces/astro/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:6904:12
      at scheduleWork (/workspaces/astro/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:78:3)
      at startWork (/workspaces/astro/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:6903:3)
      at renderToNodeStreamImpl (/workspaces/astro/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:7048:3)
      at Object.renderToStaticNodeStream (/workspaces/astro/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:7061:10)
      at file:///workspaces/astro/packages/astro/test/fixtures/static-build-frameworks/dist/renderers.mjs:204:27
      at new Promise (<anonymous>)
      at renderToStaticNodeStreamAsync (file:///workspaces/astro/packages/astro/test/fixtures/static-build-frameworks/dist/renderers.mjs:203:10)
      at async renderToStaticMarkup$1 (file:///workspaces/astro/packages/astro/test/fixtures/static-build-frameworks/dist/renderers.mjs:167:14)
      at async Object.check$1 (file:///workspaces/astro/packages/astro/test/fixtures/static-build-frameworks/dist/renderers.mjs:98:3)
      at async renderFrameworkComponent (file:///workspaces/astro/packages/astro/test/fixtures/static-build-frameworks/dist/chunks/astro_1EJwy7jw.mjs:1110:15)
      at async renderComponent (file:///workspaces/astro/packages/astro/test/fixtures/static-build-frameworks/dist/chunks/astro_1EJwy7jw.mjs:1338:10)
      at async renderChild (file:///workspaces/astro/packages/astro/test/fixtures/static-build-frameworks/dist/chunks/astro_1EJwy7jw.mjs:868:11)
 ELIFECYCLE  Command failed with exit code 1.

@mingjunlu
Copy link
Contributor

@xMohamd Hmm, that's weird. I'm not sure if it's a false alarm. As you can see, static-build-frameworks.test.js didn't do anything special during migration.

However, I did encounter the same error message (test did not finish before its parent and was cancelled) while migrating @astrojs/vercel. After searching for a while, I found that passing an async callback to describe seemed to cause this issue before Node.js 18.19.0 and 20.6.1. (See nodejs/node#48845 and nodejs/node-core-test#49)

Since different Node.js versions are used across Astro's CI, a current workaround might be avoiding passing an async callback to describe. Try to move the async part to other hooks (e.g., it, before) and see if the error message goes away. You can refer to the changes in this file. Good luck!

@xMohamd
Copy link
Contributor Author

xMohamd commented Feb 10, 2024

@mingjunlu Thanks, I tried everything you said but still got the same error

@xMohamd
Copy link
Contributor Author

xMohamd commented Feb 12, 2024

@ematipico notice that I reverted static-build-frameworks tests to the old version that used chai

@ematipico ematipico closed this Feb 15, 2024
@xMohamd xMohamd deleted the css/all branch February 15, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants