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

Add delay for system test. #16

Merged
merged 11 commits into from
Sep 27, 2018
20 changes: 17 additions & 3 deletions system-test/spanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -1385,16 +1385,26 @@ describe('Spanner', function() {
});

it('should query in callback mode', function(done) {
database.run('SELECT * FROM Singers', function(err, rows) {
const options = {
readOnly: true,
strong: true,
};

database.run('SELECT * FROM Singers', options, function(err, rows) {
assert.ifError(err);
assert.deepStrictEqual(rows.shift().toJSON(), EXPECTED_ROW);
done();
});
});

it('should query in promise mode', function(done) {
const options = {
readOnly: true,
strong: true,
};

database
.run('SELECT * FROM Singers')
.run('SELECT * FROM Singers', options)
.then(function(data) {
const rows = data[0];
assert.deepStrictEqual(rows.shift().toJSON(), EXPECTED_ROW);
Expand All @@ -1404,10 +1414,14 @@ describe('Spanner', function() {
});

it('should query in stream mode', function(done) {
const options = {
readOnly: true,
strong: true,
};
let row;

database
.runStream('SELECT * FROM Singers')
.runStream('SELECT * FROM Singers', options)
.on('error', done)
.once('data', function(row_) {
row = row_;
Expand Down