Skip to content

Instantly share code, notes, and snippets.

Avatar

Joyee Cheung joyeecheung

View GitHub Profile
View node_code_cache.cc
#include "node_native_module.h"
#include "node_internals.h"
// This file is generated by tools/generate_code_cache.js
// and is used when configure is run with `--code-cache-path`
namespace node {
namespace native_module {
static const uint8_t _http_agent_raw[] = { };
@joyeecheung
joyeecheung / failures.json
Created Aug 14, 2018
failures of recent 20 runs, 20180814
View failures.json
[
{
"source": "https://github.com/nodejs/node/pull/22310/",
"upstream": "https://ci.nodejs.org/job/node-test-pull-request/16436/",
"url": "https://ci.nodejs.org/job/node-test-commit-linux/nodes=alpine-latest-x64/20711/console",
"builtOn": "test-softlayer-alpine38_container-x64-1",
"reason": "not ok 775 parallel/test-cluster-master-error\n ---\n duration_ms: 120.106\n severity: fail\n exitcode: -15\n stack: |-\n timeout\n ...\n",
"highlight": 0,
"type": "JS_TEST_FAILURE",
"file": "parallel/test-cluster-master-error",
View database-180615.json
[
{
"source": "https://github.com/nodejs/node/pull/21346/",
"upstream": "https://ci.nodejs.org/job/node-test-commit/19271/",
"type": "JS_TEST_FAILURE",
"url": "https://ci.nodejs.org/job/node-test-commit-linux/nodes=centos6-64-gcc48/19594/console",
"reason": "not ok 1550 parallel/test-timers-throw-reschedule\n ---\n duration_ms: 0.349\n severity: fail\n stack: |-\n assert.js:42\n throw new errors.AssertionError({\n ^\n \n AssertionError [ERR_ASSERTION]: false == true\n at Timeout.common.mustCall (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos6-64-gcc48/test/parallel/test-timers-throw-reschedule.js:20:5)\n at Timeout._onTimeout (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos6-64-gcc48/test/common/index.js:478:15)\n at ontimeout (timers.js:498:11)\n at Timer.unrefdHandle (timers.js:611:5)\n ...\n",
"highlight": 0,
"file": "parallel/test-timers-throw-reschedule",
"severity": "fail"
@joyeecheung
joyeecheung / stats-by-pr-count-2018-06-14.json
Created Jun 14, 2018
Reasons of CI failure ranked by failed PR count, 2018-06-14
View stats-by-pr-count-2018-06-14.json
[
{
"count": 14,
"reason": "sequential/test-inspector-port-zero-cluster",
"prs": [
"https://github.com/nodejs/node/pull/21323/",
"https://github.com/nodejs-private/node-private/pull/136/",
"https://github.com/nodejs/node/pull/21196/",
"https://github.com/nodejs/node/pull/21256/",
"https://github.com/nodejs/node/pull/21105/",
View database-2018-06-14.json
[
{
"source": "https://github.com/nodejs/node/pull/21325/",
"upstream": "https://ci.nodejs.org/job/node-test-commit/19231/",
"type": "JS_TEST_FAILURE",
"url": "https://ci.nodejs.org/job/node-test-commit-aix/nodes=aix61-ppc64/15767/console",
"reason": "not ok 1966 parallel/test-worker-dns-terminate\n ---\n duration_ms: 2.829\n severity: crashed\n exitcode: -6\n stack: |-\n ...\n",
"highlight": 0,
"file": "parallel/test-worker-dns-terminate",
"severity": "crashed"
@joyeecheung
joyeecheung / hours.js
Created Apr 8, 2018
Get frequency of committed time, in UTC hours
View hours.js
'use strict';
const child_process = require('child_process');
const log = child_process.spawnSync('git', ['log', '--format=%cI', '-n', '10000'], {
cwd: process.cwd()
});
const dates = log.stdout.toString().trim();
const hours = dates.split('\n').map(d => new Date(d).getUTCHours());
const map = new Map();
for (const h of hours) {
if (map.has(h)) {
@joyeecheung
joyeecheung / build-llnode.sh
Last active Dec 9, 2019
Commands to build llnode on throw-away VPS with different UNIX OSs
View build-llnode.sh
# I am being lazy here by using the root perm because I am mostly testing
# on throw-away VPS
# Also, might be missing some commands, should be easy to resolve though
# Ubuntu
apt-get update
apt-get install lldb-4.0 git make python g++
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
nvm install stable
git clone --depth=1 -b merge-gyp https://github.com/joyeecheung/llnode.git
View gist:3d732fc854af1e1b22313e3a9e9a8f2a

Recent work

  • Link with lldb reported by llvm-config on MacOS: no need to use the XCode one, can work with custom builds or lldb installed with Homebrew
  • Fixed tests and Travis intergration
  • LLNODE_DEBUG=true to print details of failures during symbol loading, turned on in Travis
  • Loading symbols with shared libraries: can work with libv8 + d8 built with post-mortem support

JS API

  • Original work by @rnchamberlain, rewrote with NAN and some API changes, e.g. use iterators for instance lists to save memory.
@joyeecheung
joyeecheung / see-bench.sh
Last active Jan 25, 2018
Get the results of Node.js benchmark CI
View see-bench.sh
#/usr/bin/env bash
# Saves CI results to bench-$JOBID.txt
# output of compare.R to bench-$JOBID-results.txt
JOBID=$1
wget https://ci.nodejs.org/job/benchmark-node-micro-benchmarks/$JOBID/consoleText -O bench-$JOBID.txt
grep 'improvement' -A 10000 bench-$JOBID.txt > bench-$JOBID-results.txt
head -n 1 bench-$JOBID-results.txt > bench-$JOBID-significant.txt
grep '*' bench-$JOBID-results.txt >> bench-$JOBID-significant.txt
@joyeecheung
joyeecheung / download.sh
Last active Nov 14, 2017
Quickly download a repo at a ref without git history, useful if you need multiple tag/commit/branch of it
View download.sh
REF=8680bb9
# The following work as well
# REF=master
# REF=V8.x-staging
# REF=V8.9.1
wget https://github.com/nodejs/node/archive/$REF.tar.gz
mkdir -p $REF
tar zxvf $REF.tar.gz -C $REF --strip-components=1
cd $REF