Skip to content

Commit a46bfb5

Browse files
authored
Merge branch 'main' into renovate/babel-monorepo
2 parents 7b955c8 + 10c3032 commit a46bfb5

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

system-test/spanner.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9668,6 +9668,32 @@ describe('Spanner', () => {
96689668
);
96699669
});
96709670
});
9671+
9672+
const handleReadAndMutation = (done, database) => {
9673+
database.runTransaction(async (err, transaction) => {
9674+
assert.ifError(err);
9675+
try {
9676+
await transaction.run('SELECT abc');
9677+
} catch (err) {
9678+
// add a sleep to let the explicit begin call finish
9679+
await new Promise<void>(resolve => {
9680+
setTimeout(() => {
9681+
resolve();
9682+
}, 4000);
9683+
});
9684+
}
9685+
transaction!.insert('TxnTable', {
9686+
Key: 'k1003',
9687+
StringValue: 'mutation',
9688+
});
9689+
await transaction.commit();
9690+
done();
9691+
});
9692+
};
9693+
9694+
it('GOOGLE_STANDARD_SQL should handle commit retry based on multiplexed enable or not', done => {
9695+
handleReadAndMutation(done, DATABASE);
9696+
});
96719697
});
96729698

96739699
describe('batch transactions', () => {

0 commit comments

Comments
 (0)