Skip to content

Instantly share code, notes, and snippets.

@trentm
trentm / diff.diff
Created June 28, 2012 18:33
npm retry on 408 or 5xx only
Index: /Users/trentm/tm/npm/node_modules/npm-registry-client/lib/request.js
index cba8ba2..7781d37 100644
--- a/node_modules/npm-registry-client/lib/request.js
+++ b/node_modules/npm-registry-client/lib/request.js
@@ -88,8 +88,11 @@ function regRequest (method, where, what, etag, nofollow, cb_) {
self.log.info("retry", "registry request attempt " + currentAttempt
+ " at " + (new Date()).toLocaleTimeString())
makeRequest.call(self, method, remote, where, what, etag, nofollow
- , function (er) {
- if (operation.retry(er)) {
@trentm
trentm / 3-server-failures.log
Created June 28, 2012 03:36
npm retry testing results
npm info it worked if it ends with ok
npm info using npm@1.1.32
npm info using node@v0.6.19
npm info retry registry request attempt 1 at 20:20:29
npm http GET http://localhost:8000/bunyan
npm http 500 http://localhost:8000/bunyan
npm info retry will retry, error on last attempt: 500 Internal Server Error
npm info retry registry request attempt 2 at 20:20:39
npm http GET http://localhost:8000/bunyan
npm http 500 http://localhost:8000/bunyan
@trentm
trentm / npm.diff
Created June 28, 2012 00:25
onResponse is gone
Index: /Users/trentm/tm/npm/lib/utils/fetch.js
index f69975b..2962cf9 100644
--- a/lib/utils/fetch.js
+++ b/lib/utils/fetch.js
@@ -55,14 +55,16 @@ function makeRequest (remote, fstr, headers) {
? "https-proxy"
: "proxy")
- request({ url: remote
+ var req = request({ url: remote
@trentm
trentm / shell.log
Created June 28, 2012 00:21
npm retry
[17:08:19 trentm@banana:~/tm/npm-registry-proxy (master)]
$ (touch proxy.js && sleep 1 # ensure my npm-registry-proxy restarts
&& rm -rf tmp/cache node_modules/bunyan # start fresh
&& node ~/tm/npm/cli.js --loglevel=info \
--cache=`pwd`/tmp/cache --registry=http://localhost:8000/ \
install bunyan)
npm info it worked if it ends with ok
npm info using npm@1.1.32
npm info using node@v0.6.19
npm info retry registry request attempt 1 at 17:08:22
@trentm
trentm / test.log
Created June 15, 2012 22:40
Test run of markdown2 against all versions of Python on my Mac.
$ make test
cd test && python testall.py
-- test with Python 2.5 (/usr/local/bin/python2.5)
markdown2/tm/auto_link ... ok
markdown2/tm/auto_link_email_with_underscore [issue26] ... ok
markdown2/tm/auto_link_safe_mode [issue7, safe_mode] ... ok
markdown2/tm/basic_safe_mode [safe_mode] ... ok
markdown2/tm/basic_safe_mode_escape [safe_mode] ... ok
markdown2/tm/blockquote ... ok
markdown2/tm/blockquote_with_pre ... ok
@trentm
trentm / macosx.txt
Created May 15, 2012 17:02
node 0.6.18 RC1 test results
[09:40:19 trentm@banana:~/tmp/n]
$ wget http://nodejs.org/dist/v0.6.18/node-v0.6.18-RC1.tar.gz
--2012-05-15 09:40:19-- http://nodejs.org/dist/v0.6.18/node-v0.6.18-RC1.tar.gz
Resolving nodejs.org... 8.12.44.238
Connecting to nodejs.org|8.12.44.238|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10261465 (9.8M) [application/octet-stream]
Saving to: `node-v0.6.18-RC1.tar.gz'
] 1,374,584 143K/s eta 58s
100%[======================================================================>] 10,261,465 59.8K/s in 1m 40s
@trentm
trentm / console.log
Created April 18, 2012 07:57
markdown2 passing in Python 2.5 - 3.3
$ make test
cd test && python testall.py
-- test with Python 2.5 (/usr/local/bin/python2.5)
markdown2/tm/auto_link ... ok
markdown2/tm/auto_link_email_with_underscore [issue26] ... ok
markdown2/tm/auto_link_safe_mode [issue7, safe_mode] ... ok
markdown2/tm/basic_safe_mode [safe_mode] ... ok
markdown2/tm/basic_safe_mode_escape [safe_mode] ... ok
markdown2/tm/blockquote ... ok
markdown2/tm/blockquote_with_pre ... ok
var restify = require('restify');
var Logger = require('bunyan');
var log = new Logger({name: 'restifypretest'});
var server = restify.createServer({
name: 'restifypretest',
log: log
});
server.pre(function(req, res, next) {
@trentm
trentm / npm-debug.log
Created April 16, 2012 21:53
Attachment for npm issue #2374
info it worked if it ends with ok
verbose cli [ 'node', '/Users/trentm/opt/node-0.6/bin/npm', 'update' ]
info using npm@1.1.16
info using node@v0.6.15
verbose /Users/trentm/opt/node-0.6/bin/node node symlink
verbose config file /Users/trentm/.npmrc
verbose config file /Users/trentm/opt/node-0.6/etc/npmrc
verbose config file /Users/trentm/opt/node-0.6.15/lib/node_modules/npm/npmrc
verbose caching /Users/trentm/tmp/foo/package.json
verbose loadDefaults foo@1.0.0
@trentm
trentm / gist:2344801
Created April 9, 2012 17:14
node 0.6.15 RC2 test failures on my suspect smartos
[root@trent4 ~/tmp/n/rc2/node-v0.6.15]# make test
Waf: Entering directory `/root/tmp/n/rc2/node-v0.6.15/out'
DEST_OS: sunos
DEST_CPU: ia32
Parallel Jobs: 1
Product type: program
Waf: Leaving directory `/root/tmp/n/rc2/node-v0.6.15/out'
'build' finished successfully (0.149s)
-rwxr-xr-x 1 root root 9.9M 2012-04-09 17:08 out/Release/node
python tools/test.py --mode=release simple message