@@ -649,25 +649,10 @@ private static String baggageHeader(int start, int count) {
649649 @ Test
650650 void extract_limit_maxBytes_exceedsLimit () {
651651 W3CBaggagePropagator propagator = W3CBaggagePropagator .getInstance ();
652- // Single header over 8192 bytes — truncated to the byte limit; the entry within budget is
653- // extracted with a truncated value
654- String header = "k=" + fillChars ('v' , 8192 ); // 8194 bytes; truncated to 8192 → k=<8190 v's>
652+ // Single header over 8192 bytes — dropped entirely; partial values must not be extracted
653+ String header = "k=" + fillChars ('v' , 8192 ); // 8194 bytes
655654 Context result = propagator .extract (Context .root (), ImmutableMap .of ("baggage" , header ), getter );
656- assertThat (Baggage .fromContext (result ).getEntryValue ("k" )).isEqualTo (fillChars ('v' , 8190 ));
657- }
658-
659- @ Test
660- void extract_limit_maxBytes_partialHeader () {
661- W3CBaggagePropagator propagator = W3CBaggagePropagator .getInstance ();
662- // A header where the first entry is complete within the byte budget but the second entry's
663- // key is cut off by the truncation — only the first entry is extracted.
664- // "k1=" (3) + 8186 'v's + "," (1) + "k2=v2" (5) = 8195 bytes;
665- // truncated to 8192 → "k1=<8186 v's>,k2" (k2's "=" is beyond the budget)
666- String header = "k1=" + fillChars ('v' , 8186 ) + ",k2=v2" ;
667- Context result = propagator .extract (Context .root (), ImmutableMap .of ("baggage" , header ), getter );
668- Baggage baggage = Baggage .fromContext (result );
669- assertThat (baggage .getEntryValue ("k1" )).isEqualTo (fillChars ('v' , 8186 ));
670- assertThat (baggage .getEntryValue ("k2" )).isNull ();
655+ assertThat (Baggage .fromContext (result )).isEqualTo (Baggage .empty ());
671656 }
672657
673658 @ Test
0 commit comments