Skip to content

Commit 9c143ad

Browse files
committed
disable flaky test
1 parent c24a6c5 commit 9c143ad

File tree

1 file changed

+73
-71
lines changed

1 file changed

+73
-71
lines changed
Lines changed: 73 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
if (0) {
2+
var common = require('../../common');
3+
var connection = common.createConnection();
24

3-
var common = require('../../common');
4-
var connection = common.createConnection();
5-
6-
/*
5+
/*
76
connection.query('SELECT repeat("a", 60000000) as qqq', function (err, res) {
87
console.log(err);
98
console.log(err, res[0].qqq.length);
@@ -12,78 +11,81 @@ var connection = common.createConnection();
1211
return;
1312
*/
1413

15-
var assert = require('assert');
16-
var Buffer = require('safe-buffer').Buffer;
14+
var assert = require('assert');
15+
var Buffer = require('safe-buffer').Buffer;
1716

18-
var table = 'insert_large_test';
19-
var length = 35777416;
20-
var content = Buffer.allocUnsafe(length); // > 16 megabytes
21-
var content1 = Buffer.allocUnsafe(length); // > 16 megabytes
17+
var table = 'insert_large_test';
18+
var length = 35777416;
19+
var content = Buffer.allocUnsafe(length); // > 16 megabytes
20+
var content1 = Buffer.allocUnsafe(length); // > 16 megabytes
2221

23-
// this is to force compressed packed to be larger than uncompressed
24-
for (var i = 0; i < content.length; ++i) {
25-
content[i] = Math.floor(Math.random() * 256);
26-
content1[i] = Math.floor(Math.random() * 256);
22+
// this is to force compressed packed to be larger than uncompressed
23+
for (var i = 0; i < content.length; ++i) {
24+
content[i] = Math.floor(Math.random() * 256);
25+
content1[i] = Math.floor(Math.random() * 256);
2726

28-
// low entropy version, compressed < uncompressed
29-
if (i < length / 2) {
30-
content1[i] = 100;
27+
// low entropy version, compressed < uncompressed
28+
if (i < length / 2) {
29+
content1[i] = 100;
30+
}
3131
}
32-
}
3332

34-
var result, result2, result3, result4;
33+
var result, result2, result3, result4;
3534

36-
connection.query(
37-
'SET GLOBAL max_allowed_packet=' + (length * 2 + 2000),
38-
function(err, res) {
39-
assert.ifError(err);
40-
connection.end();
41-
var connection2 = common.createConnection();
42-
connection2.query(
43-
[
44-
'CREATE TEMPORARY TABLE `' + table + '` (',
45-
'`id` int(11) unsigned NOT NULL AUTO_INCREMENT,',
46-
'`content` longblob NOT NULL,',
47-
'PRIMARY KEY (`id`)',
48-
') ENGINE=InnoDB DEFAULT CHARSET=utf8'
49-
].join('\n')
50-
);
51-
connection2.query(
52-
'INSERT INTO ' + table + ' (content) VALUES(?)',
53-
[content],
54-
function(err, _result) {
55-
assert.ifError(err);
56-
result = _result;
57-
connection2.query(
58-
'SELECT * FROM ' + table + ' WHERE id = ' + result.insertId,
59-
function(err, _result2) {
60-
result2 = _result2;
61-
connection2.query(
62-
'INSERT INTO ' + table + ' (content) VALUES(?)',
63-
[content1],
64-
function(err, _result) {
65-
assert.ifError(err);
66-
result3 = _result;
67-
connection2.query(
68-
'SELECT * FROM ' + table + ' WHERE id = ' + result3.insertId,
69-
function(err, _result) {
70-
assert.ifError(err);
71-
result4 = _result;
72-
connection2.end();
73-
}
74-
);
75-
}
76-
);
77-
}
78-
);
79-
}
80-
);
81-
}
82-
);
35+
connection.query(
36+
'SET GLOBAL max_allowed_packet=' + (length * 2 + 2000),
37+
function(err, res) {
38+
assert.ifError(err);
39+
connection.end();
40+
var connection2 = common.createConnection();
41+
connection2.query(
42+
[
43+
'CREATE TEMPORARY TABLE `' + table + '` (',
44+
'`id` int(11) unsigned NOT NULL AUTO_INCREMENT,',
45+
'`content` longblob NOT NULL,',
46+
'PRIMARY KEY (`id`)',
47+
') ENGINE=InnoDB DEFAULT CHARSET=utf8'
48+
].join('\n')
49+
);
50+
connection2.query(
51+
'INSERT INTO ' + table + ' (content) VALUES(?)',
52+
[content],
53+
function(err, _result) {
54+
assert.ifError(err);
55+
result = _result;
56+
connection2.query(
57+
'SELECT * FROM ' + table + ' WHERE id = ' + result.insertId,
58+
function(err, _result2) {
59+
result2 = _result2;
60+
connection2.query(
61+
'INSERT INTO ' + table + ' (content) VALUES(?)',
62+
[content1],
63+
function(err, _result) {
64+
assert.ifError(err);
65+
result3 = _result;
66+
connection2.query(
67+
'SELECT * FROM ' +
68+
table +
69+
' WHERE id = ' +
70+
result3.insertId,
71+
function(err, _result) {
72+
assert.ifError(err);
73+
result4 = _result;
74+
connection2.end();
75+
}
76+
);
77+
}
78+
);
79+
}
80+
);
81+
}
82+
);
83+
}
84+
);
8385

84-
process.on('exit', function() {
85-
assert.equal(result2[0].id, String(result.insertId));
86-
assert.equal(result2[0].content.toString('hex'), content.toString('hex'));
87-
assert.equal(result4[0].content.toString('hex'), content1.toString('hex'));
88-
});
86+
process.on('exit', function() {
87+
assert.equal(result2[0].id, String(result.insertId));
88+
assert.equal(result2[0].content.toString('hex'), content.toString('hex'));
89+
assert.equal(result4[0].content.toString('hex'), content1.toString('hex'));
90+
});
8991
}

0 commit comments

Comments
 (0)