Waffle icon indicating copy to clipboard operation
Waffle copied to clipboard

When event argument matchers fail, they spam junk to the console

Open moodysalem opened this issue 5 years ago • 7 comments

I've run into this issue many times with the argument matchers where for some reason it just prints tons and tons of output before the actual error. Makes them unusable.

I'm using fish shell on Mac OS 10.15.4

Video gif

The spam can last several seconds due to the amount of output.

Stack trace from end of video:

RuntimeError: abort(AssertionError: Expected "TestParameters" event to have 1 argument(s), but has 4). Build with -s ASSERTIONS=1 for more info.
    at process.abort (/Users/moody/IdeaProjects/uniswap/v2-periphery/node_modules/solc/soljson.js:1:14382)
    at process.emit (events.js:310:20)
    at process.emit (/Users/moody/IdeaProjects/uniswap/v2-periphery/node_modules/source-map-support/source-map-support.js:485:21)
    at process.emit (/Users/moody/IdeaProjects/uniswap/v2-periphery/node_modules/ganache-core/node_modules/source-map-support/source-map-support.js:465:21)
    at processPromiseRejections (internal/process/promises.js:209:33)
    at processTicksAndRejections (internal/process/task_queues.js:98:32)

moodysalem avatar Apr 29 '20 13:04 moodysalem

It looks like this was happening because I didn't await expect and the promise resolved after the test function exited.

moodysalem avatar Apr 29 '20 13:04 moodysalem

Reopening because I see this even when I do await

See it in version 2.4.1

moodysalem avatar Apr 29 '20 15:04 moodysalem

Another stack trace:

RuntimeError: abort(TypeError: Cannot set property 'state' of undefined). Build with -s ASSERTIONS=1 for more info.
    at process.abort (/Users/moody/IdeaProjects/uniswap/v2-periphery/node_modules/solc/soljson.js:1:14382)
    at process.emit (events.js:310:20)
    at process.emit (/Users/moody/IdeaProjects/uniswap/v2-periphery/node_modules/source-map-support/source-map-support.js:485:21)
    at process.emit (/Users/moody/IdeaProjects/uniswap/v2-periphery/node_modules/ganache-core/node_modules/source-map-support/source-map-support.js:465:21)
    at processPromiseRejections (internal/process/promises.js:209:33)
    at processTicksAndRejections (internal/process/task_queues.js:98:32)

moodysalem avatar Apr 29 '20 15:04 moodysalem

This looks like solcjs failing to download the specified version, not a matcher failing. Can you confirm?

sz-piotr avatar Apr 30 '20 04:04 sz-piotr

I don’t think so. Try downloading this PR and uncommenting the assertion on line 201

https://github.com/Uniswap/uniswap-v2-periphery/pull/26/files

moodysalem avatar Apr 30 '20 06:04 moodysalem

I had a similar issue - when i got error in contract compilation and didn't catch it, there was a process.abort listener triggered in solcjs which printed all of its content to console. If error was catched, it was fine. We definitely should look into it.

vanruch avatar Apr 30 '20 07:04 vanruch

I see this all the time using a series of event argument matchers when one of the matchers fails, and it's one of the most annoying errors because I have to kill the tab if I want to run the test again immediately. My coworkers also see this error when writing tests. Here is another stack trace.

TypeError: Cannot read property 'currentRetry' of undefined
TypeError: Cannot read property 'currentRetry' of undefined

/Users/moody/IdeaProjects/c0v4r/contracts/node_modules/solc/soljson.js:1
null;var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="funct

moodysalem avatar Oct 12 '20 14:10 moodysalem