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: test serialized data errors #5804

Closed
wants to merge 2 commits into from
Closed

wip: test serialized data errors #5804

wants to merge 2 commits into from

Conversation

galargh
Copy link
Member

@galargh galargh commented Oct 4, 2024

  • Because this PR includes a bug fix, relevant tests have been included.
  • Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team.
  • I didn't do anything of this.

I'm noticing some errors in our CI that look something like:

   Error: Unable to deserialize cloned data due to invalid or unsupported version.
       at #proccessRawBuffer (node:internal/test_runner/runner:341:20)
       at FileTest.parseMessage (node:internal/test_runner/runner:277:28)
       at Socket.<anonymous> (node:internal/test_runner/runner:387:15)
       at Socket.emit (node:events:519:28)
       at addChunk (node:internal/streams/readable:561:12)
       at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
       at Readable.push (node:internal/streams/readable:392:5)
       at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)

My first hunch would be that it's something connected to the stdout stream, but honestly, I'm not sure.

First, I'll try to check whether this could be caused by our custom node test reporter by running the hardhat tests both with and without it many times and seeing what happens. We'll take it from there.


It is not because of our reporter. Here's the same error from the default reporter:

# 👷 Welcome to Hardhat v3.0.0-next.3 👷
# Subtest: test/internal/cli/init/init.ts
not ok 12 - test/internal/cli/init/init.ts
  ---
  duration_ms: 329.573679
  location: '/home/runner/work/hardhat/hardhat/v-next/hardhat/test/internal/cli/init/init.ts:1:1'
  failureType: 'uncaughtException'
  error: 'Unable to deserialize cloned data due to invalid or unsupported version.'
  code: 'ERR_TEST_FAILURE'
  stack: |-
    #proccessRawBuffer (node:internal/test_runner/runner:341:20)
    FileTest.parseMessage (node:internal/test_runner/runner:277:28)
    Socket.<anonymous> (node:internal/test_runner/runner:387:15)
    Socket.emit (node:events:519:28)
    addChunk (node:internal/streams/readable:561:12)
    readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    Readable.push (node:internal/streams/readable:392:5)
    Pipe.onStreamRead (node:internal/stream_base_commons:189:23)
  ...

What's interesting here is that we start displaying the hardhat welcome message and then the error happens. This suggests it could be in fact related to writing to the stdout from the tests. Next, I'll try to give the init an alternative stream to write to during the tests and trying to run the command many times to see if the issue persists.


Looks like disabling console.log does the trick. I'm going to close this now and implement that "fix" in a new PR.

Copy link

vercel bot commented Oct 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 6, 2024 3:35pm

Copy link

changeset-bot bot commented Oct 4, 2024

⚠️ No Changeset found

Latest commit: 3676c20

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 status:ready This issue is ready to be worked on label Oct 4, 2024
@galargh galargh force-pushed the wip/serialized-data branch from b2bc7ec to 3676c20 Compare October 6, 2024 15:34
@galargh galargh closed this Oct 6, 2024
@galargh galargh deleted the wip/serialized-data branch October 6, 2024 15:38
@galargh galargh mentioned this pull request Oct 7, 2024
3 tasks
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready This issue is ready to be worked on
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant