@@ -572,22 +572,13 @@ public void transactionRunnerWithError() {
572
572
@ Test
573
573
public void transactionRunnerWithFailedAndBeginTransaction () {
574
574
List <String > expectedReadWriteTransactionWithCommitAndBeginTransactionSpans =
575
- isMultiplexedSessionsEnabled ()
576
- ? ImmutableList .of (
577
- "CloudSpannerOperation.CreateMultiplexedSession" ,
578
- "CloudSpannerOperation.BeginTransaction" ,
579
- "CloudSpannerOperation.BatchCreateSessionsRequest" ,
580
- "CloudSpannerOperation.ExecuteUpdate" ,
581
- "CloudSpannerOperation.Commit" ,
582
- "CloudSpannerOperation.BatchCreateSessions" ,
583
- "CloudSpanner.ReadWriteTransaction" )
584
- : ImmutableList .of (
585
- "CloudSpannerOperation.BeginTransaction" ,
586
- "CloudSpannerOperation.BatchCreateSessionsRequest" ,
587
- "CloudSpannerOperation.ExecuteUpdate" ,
588
- "CloudSpannerOperation.Commit" ,
589
- "CloudSpannerOperation.BatchCreateSessions" ,
590
- "CloudSpanner.ReadWriteTransaction" );
575
+ ImmutableList .of (
576
+ "CloudSpannerOperation.BeginTransaction" ,
577
+ "CloudSpannerOperation.BatchCreateSessionsRequest" ,
578
+ "CloudSpannerOperation.ExecuteUpdate" ,
579
+ "CloudSpannerOperation.Commit" ,
580
+ "CloudSpannerOperation.BatchCreateSessions" ,
581
+ "CloudSpanner.ReadWriteTransaction" );
591
582
DatabaseClient client = getClient ();
592
583
assertEquals (
593
584
Long .valueOf (1L ),
@@ -612,7 +603,7 @@ public void transactionRunnerWithFailedAndBeginTransaction() {
612
603
Stopwatch stopwatch = Stopwatch .createStarted ();
613
604
while (spanExporter .getFinishedSpanItems ().size ()
614
605
< expectedReadWriteTransactionWithCommitAndBeginTransactionSpans .size ()
615
- && stopwatch .elapsed (). compareTo ( java . time . Duration . ofMillis ( 1000 )) < 0 ) {
606
+ && stopwatch .elapsed (TimeUnit . MILLISECONDS ) < 2000 ) {
616
607
Thread .yield ();
617
608
}
618
609
@@ -621,7 +612,11 @@ public void transactionRunnerWithFailedAndBeginTransaction() {
621
612
.getFinishedSpanItems ()
622
613
.forEach (
623
614
spanItem -> {
624
- actualSpanItems .add (spanItem .getName ());
615
+ // Ignore multiplexed sessions, as they are not used by this test and can therefore
616
+ // best be ignored, as it is not 100% certain that it has already been created.
617
+ if (!"CloudSpannerOperation.CreateMultiplexedSession" .equals (spanItem .getName ())) {
618
+ actualSpanItems .add (spanItem .getName ());
619
+ }
625
620
switch (spanItem .getName ()) {
626
621
case "CloudSpannerOperation.CreateMultiplexedSession" :
627
622
verifyRequestEvents (
0 commit comments