File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
powertools-e2e-tests/src/test/java/software/amazon/lambda/powertools/testutils/tracing Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ private Trace getTrace(List<String> traceIds) {
109109 if (!tracesResponse .hasTraces ()) {
110110 throw new TraceNotFoundException (String .format ("No trace found for traceIds %s" , traceIds ));
111111 }
112-
112+
113113 Trace traceRes = new Trace ();
114114 tracesResponse .traces ().forEach (trace -> {
115115 if (trace .hasSegments ()) {
@@ -119,6 +119,12 @@ private Trace getTrace(List<String> traceIds) {
119119 if ("AWS::Lambda::Function" .equals (document .getOrigin ()) && document .hasSubsegments ()) {
120120 LOG .debug ("Populating subsegments for document {}" , MAPPER .writeValueAsString (document ));
121121 getNestedSubSegments (document .getSubsegments (), traceRes , Collections .emptyList ());
122+ // If only the default (excluded) subsegments were populated we need to keep retrying for
123+ // our custom subsegments. They might appear later.
124+ if (traceRes .getSubsegments ().isEmpty ()) {
125+ throw new TraceNotFoundException (
126+ "Found AWS::Lambda::Function SegmentDocument with no non-excluded subsegments." );
127+ }
122128 } else if ("AWS::Lambda::Function" .equals (document .getOrigin ())) {
123129 LOG .debug (
124130 "Found AWS::Lambda::Function SegmentDocument with no subsegments. Retrying {}" ,
You can’t perform that action at this time.
0 commit comments