Skip to content

Commit

Permalink
remove old test stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus committed Mar 12, 2018
1 parent 6ee22f5 commit 10db888
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
6 changes: 3 additions & 3 deletions src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1136,8 +1136,8 @@ Table.prototype.mutate = function(entries, gaxOptions, callback) {
var entryToIndex = new Map(entries.map((entry, index) => [entry, index]));
var mutationErrorsByEntryIndex = new Map();

function onBatchResponse(previousNumRequestsMade, err) {
if (previousNumRequestsMade === numRequestsMade && err) {
function onBatchResponse(err) {
if (err) {
// The error happened before a request was even made, don't retry.
callback(err);
return;
Expand Down Expand Up @@ -1180,7 +1180,7 @@ Table.prototype.mutate = function(entries, gaxOptions, callback) {
retryOpts: retryOpts,
})
.on('request', () => numRequestsMade++)
.on('error', onBatchResponse.bind(null, numRequestsMade))
.on('error', onBatchResponse)
.on('data', function(obj) {
obj.entries.forEach(function(entry) {
var originalEntry = entryBatch[entry.index];
Expand Down
1 change: 0 additions & 1 deletion system-test/mutate-rows.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ describe('Bigtable/Table', () => {
},
};
bigtable.grpcCredentials = grpc.credentials.createInsecure();
bigtable.projectId = 'test';

const INSTANCE = bigtable.instance('instance');
const TABLE = INSTANCE.table('table');
Expand Down
22 changes: 0 additions & 22 deletions test/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1733,28 +1733,6 @@ describe('Bigtable/Table', function() {
done();
});
});

it('should not retry a pre request error', function(done) {
var calls = 0;
var error = new Error('err');
table.requestStream = function() {
calls++;
var stream = new Stream({
objectMode: true,
});

setImmediate(function() {
stream.emit('error', error);
});

return stream;
};
table.mutate(entries, function(err) {
assert.strictEqual(calls, 1);
assert.strictEqual(err, error);
done();
});
});
});
});

Expand Down

0 comments on commit 10db888

Please sign in to comment.