# HG changeset patch # User dtitov # Date 1520016152 28800 # Node ID 6a86f0deb479dcc0955c03ea1ca6822aeef0a73f # Parent 8f63fb7788bb9bc85999fc32b4f6f42b71d6447c 8170541: serviceability/jdwp/AllModulesCommandTest.java fails intermittently on Windows and Solaris Reviewed-by: sspitsyn, dholmes diff -r 8f63fb7788bb -r 6a86f0deb479 test/hotspot/jtreg/ProblemList.txt --- a/test/hotspot/jtreg/ProblemList.txt Fri Mar 02 14:47:52 2018 +0100 +++ b/test/hotspot/jtreg/ProblemList.txt Fri Mar 02 10:42:32 2018 -0800 @@ -79,7 +79,6 @@ # :hotspot_serviceability -serviceability/jdwp/AllModulesCommandTest.java 8170541 generic-all serviceability/sa/TestRevPtrsForInvokeDynamic.java 8191270 generic-all serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all diff -r 8f63fb7788bb -r 6a86f0deb479 test/hotspot/jtreg/serviceability/jdwp/JdwpReply.java --- a/test/hotspot/jtreg/serviceability/jdwp/JdwpReply.java Fri Mar 02 14:47:52 2018 +0100 +++ b/test/hotspot/jtreg/serviceability/jdwp/JdwpReply.java Fri Mar 02 10:42:32 2018 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,17 @@ int dataLength = length - HEADER_LEN; if (dataLength > 0) { data = new byte[dataLength]; - ds.read(data, 0, dataLength); + int bytesRead = ds.read(data, 0, dataLength); + // For large data JDWP agent sends two packets: 1011 bytes in + // the first packet (1000 + HEADER_LEN) and the rest in the + // second packet. + if (bytesRead > 0 && bytesRead < dataLength) { + System.out.println("[" + getClass().getName() + "] Only " + + bytesRead + " bytes of " + dataLength + " were " + + "read in the first packet. Reading the rest..."); + ds.read(data, bytesRead, dataLength - bytesRead); + } + parseData(new DataInputStream(new ByteArrayInputStream(data))); } }