Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test excessive Memory Usage #1211

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Prev

added piecelength tests

  • Loading branch information
disarticulate committed Oct 25, 2017
commit 654fa58aa74b389d1e6c6087b5123f77b393c964
@@ -20,7 +20,7 @@ test('seed Multiple Torrents', function (t) {
var client = new WebTorrent({ dht: false, tracker: false })
var opts = {
announceList: [[]],
pieceLength: 1000000
pieceLength: 100000
}
client.seed(img, opts, function (torrent) {
t.equal(torrent.infoHash,'fe83c6629dc58cc08b7809256000ad068a167b95')
@@ -0,0 +1,39 @@
var Buffer = require('safe-buffer').Buffer
var test = require('tape')
var WebTorrent = require('../../')
var fs = require('fs')

var data = fs.readFileSync('test/browser/data/data2.3MB.base64')
var img = Buffer.from(data, 'base64')
img.name = 'img.png'

var data2 = fs.readFileSync('test/browser/data/data2.5MB.base64')
var img2 = Buffer.from(data2, 'base64')
img2.name = 'img2.png'

var data3 = fs.readFileSync('test/browser/data/data2.7MB.base64')
var img3 = Buffer.from(data3, 'base64')
img3.name = 'img3.png'

test('seed Multiple Torrents', function (t) {
t.plan(4)
var client = new WebTorrent({ dht: false, tracker: false })
var opts = {
announceList: [[]],
pieceLength: 10000
}
client.seed(img, opts, function (torrent) {
t.equal(torrent.infoHash,'fe83c6629dc58cc08b7809256000ad068a167b95')
console.warn(torrent)
})

client.seed(img2, opts, function (torrent) {
t.equal(torrent.infoHash, 'fd5c8c050571e1f8c369541ed5560f7696931e3f')
console.warn(torrent)
})
client.seed(img3, opts, function (torrent) {
t.equal(torrent.infoHash,'c36facf1ca9d3071a81bc8f85f77d3fa3b684048')
t.equal(torrent, window.test.torrent)
console.warn(torrent)
})
})
@@ -0,0 +1,39 @@
var Buffer = require('safe-buffer').Buffer
var test = require('tape')
var WebTorrent = require('../../')
var fs = require('fs')

var data = fs.readFileSync('test/browser/data/data2.3MB.base64')
var img = Buffer.from(data, 'base64')
img.name = 'img.png'

var data2 = fs.readFileSync('test/browser/data/data2.5MB.base64')
var img2 = Buffer.from(data2, 'base64')
img2.name = 'img2.png'

var data3 = fs.readFileSync('test/browser/data/data2.7MB.base64')
var img3 = Buffer.from(data3, 'base64')
img3.name = 'img3.png'

test('seed Multiple Torrents', function (t) {
t.plan(4)
var client = new WebTorrent({ dht: false, tracker: false })
var opts = {
announceList: [[]],
pieceLength: 100000
}
client.seed(img, opts, function (torrent) {
t.equal(torrent.infoHash,'fe83c6629dc58cc08b7809256000ad068a167b95')
console.warn(torrent)
})

client.seed(img2, opts, function (torrent) {
t.equal(torrent.infoHash, 'fd5c8c050571e1f8c369541ed5560f7696931e3f')
console.warn(torrent)
})
client.seed(img3, opts, function (torrent) {
t.equal(torrent.infoHash,'c36facf1ca9d3071a81bc8f85f77d3fa3b684048')
t.equal(torrent, window.test.torrent)
console.warn(torrent)
})
})
@@ -0,0 +1,39 @@
var Buffer = require('safe-buffer').Buffer
var test = require('tape')
var WebTorrent = require('../../')
var fs = require('fs')

var data = fs.readFileSync('test/browser/data/data2.3MB.base64')
var img = Buffer.from(data, 'base64')
img.name = 'img.png'

var data2 = fs.readFileSync('test/browser/data/data2.5MB.base64')
var img2 = Buffer.from(data2, 'base64')
img2.name = 'img2.png'

var data3 = fs.readFileSync('test/browser/data/data2.7MB.base64')
var img3 = Buffer.from(data3, 'base64')
img3.name = 'img3.png'

test('seed Multiple Torrents', function (t) {
t.plan(4)
var client = new WebTorrent({ dht: false, tracker: false })
var opts = {
announceList: [[]],
pieceLength: 1000000
}
client.seed(img, opts, function (torrent) {
t.equal(torrent.infoHash,'fe83c6629dc58cc08b7809256000ad068a167b95')
console.warn(torrent)
})

client.seed(img2, opts, function (torrent) {
t.equal(torrent.infoHash, 'fd5c8c050571e1f8c369541ed5560f7696931e3f')
console.warn(torrent)
})
client.seed(img3, opts, function (torrent) {
t.equal(torrent.infoHash,'c36facf1ca9d3071a81bc8f85f77d3fa3b684048')
t.equal(torrent, window.test.torrent)
console.warn(torrent)
})
})
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.