avajs / ava

Node.js test runner that lets you develop with confidence 🚀
MIT License
20.72k stars 1.41k forks source link

Ava seems to not work on new LTS 12.16.2 #2446

Closed ftaiolivista closed 4 years ago

ftaiolivista commented 4 years ago

const test = require('ava')

test('foo', t => { t.pass() })

test('bar', async t => { const bar = Promise.resolve('bar') t.is(await bar, 'bar') })

Result:

Node.js report completed
 1: 0xa02f90 node::Abort() [node]
 2: 0xa033b5 node::OnFatalError(char const*, char const*) [node]
 3: 0xb76ffe v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xb77379 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd23ad5  [node]
 6: 0xd24166 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
 7: 0xd309e5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
 8: 0xd31895 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 9: 0xd3434c v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xcfaf1b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
11: 0x103d85e v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
12: 0x13c03d9  [node]
[1]    35712 abort (core dumped)  ./node_modules/.bin/ava t.js

NODE DUMP

{
  "header": {
    "reportVersion": 2,
    "event": "Allocation failed - JavaScript heap out of memory",
    "trigger": "FatalError",
    "filename": "report.20200409.101021.35712.0.001.json",
    "dumpEventTime": "2020-04-09T10:10:21Z",
    "dumpEventTimeStamp": "1586419821666",
    "processId": 35712,
    "threadId": null,
    "cwd": "/home/vista/dev/clinic/clinic",
    "commandLine": [
      "node",
      "./node_modules/.bin/ava",
      "t.js"
    ],
    "nodejsVersion": "v12.16.2",
    "glibcVersionRuntime": "2.31",
    "glibcVersionCompiler": "2.17",
    "wordSize": 64,
    "arch": "x64",
    "platform": "linux",
    "componentVersions": {
      "node": "12.16.2",
      "v8": "7.8.279.23-node.34",
      "uv": "1.34.2",
      "zlib": "1.2.11",
      "brotli": "1.0.7",
      "ares": "1.15.0",
      "modules": "72",
      "nghttp2": "1.40.0",
      "napi": "5",
      "llhttp": "2.0.4",
      "http_parser": "2.9.3",
      "openssl": "1.1.1e",
      "cldr": "36.0",
      "icu": "65.1",
      "tz": "2019c",
      "unicode": "12.1"
    },
    "release": {
      "name": "node",
      "lts": "Erbium",
      "headersUrl": "https://nodejs.org/download/release/v12.16.2/node-v12.16.2-headers.tar.gz",
      "sourceUrl": "https://nodejs.org/download/release/v12.16.2/node-v12.16.2.tar.gz"
    },
    "osName": "Linux",
    "osRelease": "5.6.2-zen1-2-zen",
    "osVersion": "#1 ZEN SMP PREEMPT Sun, 05 Apr 2020 05:14:52 +0000",
    "osMachine": "x86_64",
    "cpus": [
      {
        "model": "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz",
        "speed": 2534,
        "user": 4518300,
        "nice": 38700,
        "sys": 1246400,
        "idle": 32374900,
        "irq": 151000
      },
      {
        "model": "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz",
        "speed": 2510,
        "user": 4937100,
        "nice": 12500,
        "sys": 1203200,
        "idle": 32237500,
        "irq": 118500
      },
      {
        "model": "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz",
        "speed": 2533,
        "user": 4714800,
        "nice": 26700,
        "sys": 1275200,
        "idle": 32400900,
        "irq": 115700
      },
      {
        "model": "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz",
        "speed": 2513,
        "user": 4584600,
        "nice": 23500,
        "sys": 1440100,
        "idle": 31620600,
        "irq": 422300
      },
      {
        "model": "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz",
        "speed": 2581,
        "user": 5190500,
        "nice": 15500,
        "sys": 1248500,
        "idle": 31909500,
        "irq": 117300
      },
      {
        "model": "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz",
        "speed": 2550,
        "user": 4830400,
        "nice": 24900,
        "sys": 1247900,
        "idle": 32159700,
        "irq": 132800
      },
      {
        "model": "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz",
        "speed": 2561,
        "user": 4965600,
        "nice": 14200,
        "sys": 1233300,
        "idle": 32161000,
        "irq": 114300
      },
      {
        "model": "Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz",
        "speed": 2550,
        "user": 6268700,
        "nice": 33900,
        "sys": 1267400,
        "idle": 30784500,
        "irq": 160500
      }
    ],
    "networkInterfaces": [
      {
        "name": "lo",
        "internal": true,
        "mac": "00:00:00:00:00:00",
        "address": "127.0.0.1",
        "netmask": "255.0.0.0",
        "family": "IPv4"
      },
      {
        "name": "enp1s0",
        "internal": false,
        "mac": "dc:4a:3e:47:1b:ff",
        "address": "192.168.0.38",
        "netmask": "255.255.255.0",
        "family": "IPv4"
      },
      {
        "name": "enp1s0",
        "internal": false,
        "mac": "dc:4a:3e:47:1b:ff",
        "address": "192.168.0.101",
        "netmask": "255.255.255.0",
        "family": "IPv4"
      },
      {
        "name": "lo",
        "internal": true,
        "mac": "00:00:00:00:00:00",
        "address": "::1",
        "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
        "family": "IPv6",
        "scopeid": 0
      },
      {
        "name": "enp1s0",
        "internal": false,
        "mac": "dc:4a:3e:47:1b:ff",
        "address": "fe80::de4a:3eff:fe47:1bff",
        "netmask": "ffff:ffff:ffff:ffff::",
        "family": "IPv6",
        "scopeid": 2
      }
    ],
    "host": "fbn.vista.it"
  },
  "javascriptStack": {
    "message": "No stack.",
    "stack": [
      "Unavailable."
    ]
  },
  "nativeStack": [
    {
      "pc": "0x0000000000b40285",
      "symbol": "report::TriggerNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, std::string const&, v8::Local<v8::String>) [node]"
    },
    {
      "pc": "0x0000000000a033ef",
      "symbol": "node::OnFatalError(char const*, char const*) [node]"
    },
    {
      "pc": "0x0000000000b76ffe",
      "symbol": "v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]"
    },
    {
      "pc": "0x0000000000b77379",
      "symbol": "v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]"
    },
    {
      "pc": "0x0000000000d23ad5",
      "symbol": " [node]"
    },
    {
      "pc": "0x0000000000d24166",
      "symbol": "v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]"
    },
    {
      "pc": "0x0000000000d309e5",
      "symbol": "v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]"
    },
    {
      "pc": "0x0000000000d31895",
      "symbol": "v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]"
    },
    {
      "pc": "0x0000000000d3434c",
      "symbol": "v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]"
    },
    {
      "pc": "0x0000000000cfaf1b",
      "symbol": "v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]"
    },
    {
      "pc": "0x000000000103d85e",
      "symbol": "v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]"
    },
    {
      "pc": "0x00000000013c03d9",
      "symbol": " [node]"
    }
  ],
  "javascriptHeap": {
    "totalMemory": 2163388416,
    "totalCommittedMemory": 2152416440,
    "usedMemory": 2129862024,
    "availableMemory": 64568288,
    "memoryLimit": 2197815296,
    "heapSpaces": {
      "read_only_space": {
        "memorySize": 262144,
        "committedMemory": 33088,
        "capacity": 32808,
        "used": 32808,
        "available": 0
      },
      "new_space": {
        "memorySize": 16777216,
        "committedMemory": 6563368,
        "capacity": 8379648,
        "used": 1251112,
        "available": 7128536
      },
      "old_space": {
        "memorySize": 1791107072,
        "committedMemory": 1790787832,
        "capacity": 1788860032,
        "used": 1774226808,
        "available": 14633224
      },
      "code_space": {
        "memorySize": 692224,
        "committedMemory": 616864,
        "capacity": 399008,
        "used": 399008,
        "available": 0
      },
      "map_space": {
        "memorySize": 1052672,
        "committedMemory": 918200,
        "capacity": 536240,
        "used": 536240,
        "available": 0
      },
      "large_object_space": {
        "memorySize": 353447936,
        "committedMemory": 353447936,
        "capacity": 353413264,
        "used": 353413264,
        "available": 0
      },
      "code_large_object_space": {
        "memorySize": 49152,
        "committedMemory": 49152,
        "capacity": 2784,
        "used": 2784,
        "available": 0
      },
      "new_large_object_space": {
        "memorySize": 0,
        "committedMemory": 0,
        "capacity": 8379648,
        "used": 0,
        "available": 8379648
      }
    }
  },
  "resourceUsage": {
    "userCpuSeconds": 61.7308,
    "kernelCpuSeconds": 10.8181,
    "cpuConsumptionPercent": 213.379,
    "maxRss": 2295304192,
    "pageFaults": {
      "IORequired": 0,
      "IONotRequired": 588122
    },
    "fsActivity": {
      "reads": 0,
      "writes": 8
    }
  },
  "uvthreadResourceUsage": {
    "userCpuSeconds": 31.5458,
    "kernelCpuSeconds": 1.64772,
    "cpuConsumptionPercent": 97.628,
    "fsActivity": {
      "reads": 0,
      "writes": 24
    }
  },
  "libuv": [
  ],
  "workers": [
  ],
  "environmentVariables": {
    "COLORFGBG": "0;15",
    "COLORTERM": "truecolor",
    "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus",
    "DESKTOP_SESSION": "/usr/share/xsessions/plasma",
    "DISPLAY": ":0",
    "GDK_BACKEND": "x11",
    "GIO_LAUNCHED_DESKTOP_FILE": "/usr/share/applications/org.kde.konsole.desktop",
    "GIO_LAUNCHED_DESKTOP_FILE_PID": "24003",
    "GRADLE_HOME": "/usr/share/java/gradle",
    "GTK_MODULES": "canberra-gtk-module",
    "HOME": "/home/vista",
    "KDE_FULL_SESSION": "true",
    "KDE_SESSION_UID": "1000",
    "KDE_SESSION_VERSION": "5",
    "KONSOLE_DBUS_SERVICE": ":1.149",
    "KONSOLE_DBUS_SESSION": "/Sessions/1",
    "KONSOLE_DBUS_WINDOW": "/Windows/1",
    "KONSOLE_VERSION": "191203",
    "LANG": "en_US.UTF-8",
    "LANGUAGE": "",
    "LC_TIME": "it_IT.UTF-8",
    "LOGNAME": "vista",
    "MAIL": "/var/spool/mail/vista",
    "MOZ_PLUGIN_PATH": "/usr/lib/mozilla/plugins",
    "OLDPWD": "/home/vista/dev/clinic",
    "PAM_KWALLET5_LOGIN": "/run/user/1000/kwallet5.socket",
    "PATH": "/home/vista/.nvm/versions/node/v12.16.2/bin:/home/vista/.config/composer/vendor/bin:/home/vista/bin:/usr/local/bin:/home/vista/.yarn/bin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl",
    "PROFILEHOME": "",
    "PWD": "/home/vista/dev/clinic/clinic",
    "QT_AUTO_SCREEN_SCALE_FACTOR": "0",
    "SESSION_MANAGER": "local/fbn.vista.it:@/tmp/.ICE-unix/948,unix/fbn.vista.it:/tmp/.ICE-unix/948",
    "SHELL": "/usr/bin/zsh",
    "SHELL_SESSION_ID": "3290f6368f0248549f1ebb6fb88e2cce",
    "SHLVL": "1",
    "TERM": "xterm-256color",
    "USER": "vista",
    "WINDOWID": "67108871",
    "XAUTHORITY": "/home/vista/.Xauthority",
    "XCURSOR_SIZE": "0",
    "XCURSOR_THEME": "Oxygen_Yellow",
    "XDG_CURRENT_DESKTOP": "KDE",
    "XDG_RUNTIME_DIR": "/run/user/1000",
    "XDG_SEAT": "seat0",
    "XDG_SEAT_PATH": "/org/freedesktop/DisplayManager/Seat0",
    "XDG_SESSION_CLASS": "user",
    "XDG_SESSION_DESKTOP": "KDE",
    "XDG_SESSION_ID": "1",
    "XDG_SESSION_PATH": "/org/freedesktop/DisplayManager/Session0",
    "XDG_SESSION_TYPE": "x11",
    "XDG_VTNR": "1",
    "_JAVA_OPTIONS": "-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true",
    "LC_ALL": "en_US.UTF-8",
    "SUDO_EDITOR": "kate",
    "NVM_DIR": "/home/vista/.nvm",
    "NVM_CD_FLAGS": "-q",
    "NVM_BIN": "/home/vista/.nvm/versions/node/v12.16.2/bin",
    "NVM_INC": "/home/vista/.nvm/versions/node/v12.16.2/include/node",
    "PAGER": "less",
    "LESS": "-R",
    "LSCOLORS": "Gxfxcxdxbxegedabagacad",
    "LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:",
    "PROMPT_EOL_MARK": "",
    "CONDA_CHANGEPS1": "no",
    "VIRTUAL_ENV_DISABLE_PROMPT": "12",
    "_": "/home/vista/dev/clinic/clinic/./node_modules/.bin/ava"
  },
  "userLimits": {
    "core_file_size_blocks": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "data_seg_size_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "file_size_blocks": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "max_locked_memory_bytes": {
      "soft": 65536,
      "hard": 65536
    },
    "max_memory_size_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "open_files": {
      "soft": 524288,
      "hard": 524288
    },
    "stack_size_bytes": {
      "soft": 8388608,
      "hard": "unlimited"
    },
    "cpu_time_seconds": {
      "soft": "unlimited",
      "hard": "unlimited"
    },
    "max_user_processes": {
      "soft": 79596,
      "hard": 79596
    },
    "virtual_memory_kbytes": {
      "soft": "unlimited",
      "hard": "unlimited"
    }
  },
  "sharedObjects": [
    "linux-vdso.so.1",
    "/usr/lib/libdl.so.2",
    "/usr/lib/libstdc++.so.6",
    "/usr/lib/libm.so.6",
    "/usr/lib/libgcc_s.so.1",
    "/usr/lib/libpthread.so.0",
    "/usr/lib/libc.so.6",
    "/lib64/ld-linux-x86-64.so.2"
  ]
}
novemberborn commented 4 years ago

Does it work with a previous Node.js version? The changes are insignificant: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V12.md#12.16.2

This works for me, locally:

❯ node -v                                                                                                               v12.16.2

❯ cat test.js                                                                                                           const test = require('ava')

test('foo', t => {
t.pass()
})

test('bar', async t => {
const bar = Promise.resolve('bar')
t.is(await bar, 'bar')
})

❯ npx ava test.js                                                                                                       

  2 tests passed

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)

ftaiolivista commented 4 years ago

You are right. Cleaned yarn cache, reinstalled project and deps and now it works. Thank you.