@@ -147,7 +147,12 @@ public static Matcher<JSONObject> kvInt(String key, Matcher<Integer> matcher) {
147147 @ SafeVarargs
148148 public static void verifySchema (JSONObject response , Matcher <JSONObject >... matchers ) {
149149 try {
150- verify (response .getJSONArray ("schema" ), matchers );
150+ JSONArray schema = response .getJSONArray ("schema" );
151+ LOG .info (
152+ "[TRIAGE] verifySchema - expected {} columns, actual {} columns" ,
153+ matchers .length ,
154+ schema .length ());
155+ verify (schema , matchers );
151156 } catch (Exception e ) {
152157 LOG .error (String .format ("verify schema failed, response: %s" , response .toString ()), e );
153158 throw e ;
@@ -166,7 +171,14 @@ public static void verifySchemaInOrder(JSONObject response, Matcher<JSONObject>.
166171
167172 @ SafeVarargs
168173 public static void verifyDataRows (JSONObject response , Matcher <JSONArray >... matchers ) {
169- verify (response .getJSONArray ("datarows" ), matchers );
174+ // ponytail: debug logging for multi-shard triage
175+ JSONArray actual = response .getJSONArray ("datarows" );
176+ LOG .info (
177+ "[TRIAGE] verifyDataRows - expected {} rows, actual {} rows" ,
178+ matchers .length ,
179+ actual .length ());
180+ LOG .info ("[TRIAGE] Actual data rows: {}" , actual .toString ());
181+ verify (actual , matchers );
170182 }
171183
172184 @ SafeVarargs
@@ -204,8 +216,20 @@ public static void verifyNumOfRows(JSONObject response, int numOfRow) {
204216 public static <T > void verify (JSONArray array , Matcher <T >... matchers ) {
205217 List <T > objects = new ArrayList <>();
206218 array .iterator ().forEachRemaining (o -> objects .add ((T ) o ));
207- assertEquals (matchers .length , objects .size ());
208- assertThat (objects , containsInAnyOrder (matchers ));
219+ // ponytail: debug logging for multi-shard triage
220+ if (matchers .length != objects .size ()) {
221+ LOG .warn (
222+ "[TRIAGE] verify() count mismatch - expected {}, got {}" ,
223+ matchers .length ,
224+ objects .size ());
225+ }
226+ try {
227+ assertEquals (matchers .length , objects .size ());
228+ assertThat (objects , containsInAnyOrder (matchers ));
229+ } catch (AssertionError e ) {
230+ LOG .error ("[TRIAGE] verify() failed - assertion error: {}" , e .getMessage ());
231+ throw e ;
232+ }
209233 }
210234
211235 // TODO: this is temporary fix for fixing serverless tests to pass as it creates multiple shards
@@ -239,8 +263,20 @@ public static <T> void verifyAddressRow(JSONArray array, Matcher<T>... matchers)
239263 public static <T > void verifyInOrder (JSONArray array , Matcher <T >... matchers ) {
240264 List <T > objects = new ArrayList <>();
241265 array .iterator ().forEachRemaining (o -> objects .add ((T ) o ));
242- assertEquals (matchers .length , objects .size ());
243- assertThat (objects , contains (matchers ));
266+ // ponytail: debug logging for multi-shard triage
267+ if (matchers .length != objects .size ()) {
268+ LOG .warn (
269+ "[TRIAGE] verifyInOrder() count mismatch - expected {}, got {}" ,
270+ matchers .length ,
271+ objects .size ());
272+ }
273+ try {
274+ assertEquals (matchers .length , objects .size ());
275+ assertThat (objects , contains (matchers ));
276+ } catch (AssertionError e ) {
277+ LOG .error ("[TRIAGE] verifyInOrder() failed - assertion error: {}" , e .getMessage ());
278+ throw e ;
279+ }
244280 }
245281
246282 @ SuppressWarnings ("unchecked" )
0 commit comments