File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ describe('EndToEnd', () => {
170170
171171 afterEach ( async ( ) => {
172172 await tracerProvider . forceFlush ( ) ;
173+ await tracerProvider . shutdown ( ) ;
173174 traceExporter . reset ( ) ;
174175 spannerMock . resetRequests ( ) ;
175176 spanner . close ( ) ;
@@ -323,7 +324,16 @@ describe('EndToEnd', () => {
323324 database
324325 . runStream ( 'SELECT 1' )
325326 . on ( 'data' , row => { } )
326- . on ( 'error' , assert . ifError )
327+ . on ( 'error' , err => {
328+ // De-flake by ignoring grpc.status.CANCELLED as we've
329+ // seen on the Github test runners, due to timing.
330+ const grpcErr = err as grpc . ServiceError ;
331+ if ( ! grpcErr ) {
332+ assert . ifError ( err ) ;
333+ } else if ( grpcErr . code != grpc . status . CANCELLED ) {
334+ assert . ifError ( err ) ;
335+ }
336+ } )
327337 . on ( 'end' , ( ) => {
328338 traceExporter . forceFlush ( ) ;
329339 const spans = traceExporter . getFinishedSpans ( ) ;
You can’t perform that action at this time.
0 commit comments