Skip to content

Commit 1ec6bb6

Browse files
committed
Fix for Polaris issues and test failures.
1 parent c849bba commit 1ec6bb6

8 files changed

+23
-21
lines changed

lib/documents.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2659,7 +2659,7 @@ function collectDocUris(forestName, jobState){
26592659
jobState.error = err;
26602660
jobState.stream.emit('error', err);
26612661
}
2662-
finishOnQueryAllDocs(jobState);
2662+
finishOnQueryAllDocs(jobState);
26632663
});
26642664
}
26652665

lib/patch-builder.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ function replace() {
446446
continue;
447447
}
448448
if (apply === null || apply === undefined) {
449-
apply = arg.apply;
449+
if(arg){
450+
apply = arg.apply;
451+
}
450452
if (apply != null) {
451453
content = arg.content;
452454
continue;

lib/resources-exec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function writeResources(self, method, responseType, args) {
243243
}
244244

245245
operation.requestPartList = [];
246-
if (typeof documents !== 'undefined') {
246+
if (typeof documents !== 'undefined' && documents !== null) {
247247
for (var i=0; i < documents.length; i++) {
248248
addPart(operation, documents[i]);
249249
}

lib/responder.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ function responseDispatcher(response) {
102102
}
103103

104104
dispatcher = new MultipartDispatcher(operation);
105-
} else if (20 <= responseTypeLen && responseType.substr(0, 20) === 'application/json-seq') {
105+
} else if (20 <= responseTypeLen && responseType && responseType.substr(0, 20) === 'application/json-seq') {
106106
dispatcher = new JSONSeqDispatcher(operation);
107-
} else if (8 <= responseTypeLen && responseType.substr(0, 8) === 'text/csv') {
107+
} else if (8 <= responseTypeLen && responseType && responseType.substr(0, 8) === 'text/csv') {
108108
dispatcher = new CSVDispatcher(operation);
109109
} else {
110110
if (expectedType === 'multipart') {

lib/transactions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Transactions.prototype.open = function openTransaction() {
9494
}
9595
throw new Error('unknown parameter for transaction open: '+arg);
9696
}
97-
} else if (argLen === 1) {
97+
} else if (argLen === 1 && arg) {
9898
transactionName = arg.transactionName;
9999
timeLimit = arg.timeLimit;
100100
withState = arg.withState;

test-basic/endpoint-proxy.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ void 0;`;
236236
.execute(multiNodeInputMultiOutputDecl.functionName, {input:input})
237237
.then(function(output) {
238238
(output === void 0).should.equal(false);
239-
input.length.should.equal(output.length);
239+
if(output){
240+
input.length.should.equal(output.length);
241+
}
240242
for (let i=0; i < input.length; i++) {
241243
const expected = input[i];
242244
const actual = output[i];

test-complete/nodejs-documents-values.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,9 @@ describe('Document tuples test', function () {
288288
var strData = JSON.stringify(response);
289289
//console.log(strData);
290290
strData.should.containEql('"name":"correlation","_value":"0.263822426505543"');
291-
strData.should.containEql[('"name":"covariance","_value":"0.35"') || ('"name":"covariance","_value":"0.349999999999998"')];
291+
strData.should.containEql(('"name":"covariance","_value":"0.35"') || ('"name":"covariance","_value":"0.349999999999998"'));
292292
done();
293-
}, done);
293+
}).catch(error=> done(error));
294294
});
295295

296296
it('should do max, min, sum, average aggregates', function (done) {

test-complete/nodejs-optic-generate-views.js

+10-12
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ function waitForViewCreate(wTime) {
7070
}
7171

7272
describe('Nodejs Optic generate views test', function () {
73+
this.timeout(20000);
7374
it('TEST 1 - join left outer with array of on', function (done) {
7475

7576
const plan1 =
@@ -101,9 +102,9 @@ describe('Nodejs Optic generate views test', function () {
101102
}).
102103
result(function (response) {
103104
// console.log(JSON.stringify(response, null, 4));
105+
done();
104106
});
105-
done();
106-
}, done);
107+
}).catch(error=>done(error));
107108
});
108109

109110
waitForViewCreate(10000);
@@ -126,8 +127,7 @@ describe('Nodejs Optic generate views test', function () {
126127
expect(row5['InnerJoin.keymatch.amount'].value).to.equal(10.01);
127128
done();
128129
}, function (error) {
129-
console.log(JSON.stringify(error, null, 2));
130-
done();
130+
done(error);
131131
});
132132
});
133133

@@ -158,9 +158,9 @@ describe('Nodejs Optic generate views test', function () {
158158
}).
159159
result(function (response) {
160160
// console.log(JSON.stringify(response, null, 4));
161+
done();
161162
});
162-
done();
163-
}, done);
163+
}).catch(error=>done(error));
164164
});
165165

166166
waitForViewCreate(10000);
@@ -181,8 +181,7 @@ describe('Nodejs Optic generate views test', function () {
181181
expect(row7['sparql.groupmin.min_sales'].value).to.equal(10000000);
182182
done();
183183
}, function (error) {
184-
console.log(JSON.stringify(error, null, 2));
185-
done();
184+
done(error);
186185
});
187186
});
188187

@@ -218,9 +217,9 @@ describe('Nodejs Optic generate views test', function () {
218217
}).
219218
result(function (response) {
220219
// console.log(JSON.stringify(response, null, 4));
220+
done();
221221
});
222-
done();
223-
}, done);
222+
}).catch(error=>done(error));
224223
});
225224

226225
waitForViewCreate(10000);
@@ -241,8 +240,7 @@ describe('Nodejs Optic generate views test', function () {
241240
expect(row3['lexicons.orderbyselect.date'].value).to.equal('2007-01-01');
242241
done();
243242
}, function (error) {
244-
console.log(JSON.stringify(error, null, 2));
245-
done();
243+
done(error);
246244
});
247245
});
248246
});

0 commit comments

Comments
 (0)