Skip to content

Instantly share code, notes, and snippets.

@igorzi
Created November 1, 2011 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorzi/1332271 to your computer and use it in GitHub Desktop.
Save igorzi/1332271 to your computer and use it in GitHub Desktop.
From 252a3da26fcead9cc1952b62dea1b873f5c74205 Mon Sep 17 00:00:00 2001
From: Igor Zinkovsky <igorzi@microsoft.com>
Date: Tue, 1 Nov 2011 16:30:42 -0700
Subject: [PATCH] fix pummel/test-net-throttle on windows
---
test/pummel/test-net-throttle.js | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/test/pummel/test-net-throttle.js b/test/pummel/test-net-throttle.js
index 923ba2d..9c49d83 100644
--- a/test/pummel/test-net-throttle.js
+++ b/test/pummel/test-net-throttle.js
@@ -27,6 +27,7 @@ var assert = require('assert');
var net = require('net');
var N = 160 * 1024;
+var part_N = N / 3;
var chars_recved = 0;
var npauses = 0;
@@ -40,7 +41,9 @@ console.log('start server on port ' + common.PORT);
var server = net.createServer(function(connection) {
connection.on('connect', function() {
- assert.equal(false, connection.write(body));
+ connection.write(body.slice(0, part_N));
+ connection.write(body.slice(part_N, 2 * part_N));
+ assert.equal(false, connection.write(body.slice(2 * part_N, N)));
console.log('bufferSize: ' + connection.bufferSize);
assert.ok(0 <= connection.bufferSize &&
connection.bufferSize <= N);
--
1.7.4.msysgit.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment