File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff 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' , ( ) => {
You can’t perform that action at this time.
0 commit comments