Troy-Peng-97 opened a new pull request #457: URL: https://github.com/apache/struts/pull/457
The test method testValidationFails in test class JSONValidationInterceptorTest is flaky. The "TestUtils.normalize" function will break the order of the original list, and there are two potential orders. ["Tooshort","Thisisnoemail"], and ["Thisisnoemail", "Tooshort"] The assertion test only test against one order: ["Tooshort","Thisisnoemail"], and thus the test will fail if the second order is returned by the normalize function. To fix this flaky test, I add two assertion tests to verify that two strings "Tooshort" and "Thisisnoemail" do exist in the normalized string, and then check the indexes of those two strings. If the string "Thisisnoemail" has a smaller index, swap those two strings, and the order of the list is preserved. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@struts.apache.org For additional commands, e-mail: dev-h...@struts.apache.org