Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a flaky test. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix a flaky test. #1

wants to merge 1 commit into from

Conversation

LALAYANG
Copy link
Owner

  1. The test failure:
  • I ran mvn edu.illinois:nondex-maven-plugin:1.1.2:nondex -Dtest=com.lazerycode.jmeter.json.TestConfigTest#createConfigFromResourceFile
    Here are the details of NonDex.
  • The test com.lazerycode.jmeter.json.TestConfigTest#createConfigFromResourceFile fails as follows:
at com.lazerycode.jmeter.json.TestConfigTest.createConfigFromResourceFile(TestConfigTest.java:28)
Error: TestConfigTest.createConfigFromResourceFile:28 
expected:<"{"[executionID":"test-execution","jmeterDirectoryPath":null,"runtimeJarName":null,"resultsOutputIsCSVFormat":false,"generateReports":false,"resultFilesLocations":[]],"propertiesMap":nul...> 
but was:<"{"[generateReports":false,"resultsOutputIsCSVFormat":false,"jmeterDirectoryPath":null,"resultFilesLocations":[],"executionID":"test-execution","runtimeJarName":null],"propertiesMap":nul...>
  1. Why it fails:
  • In src/main/java/com/lazerycode/jmeter/json/TestConfigurationWrapper.java, mapper.writeValueAsString(testConfiguration) serializes Java objects as JSON output, but the order of objects being mapped into a string by ObjectMapper changes.
  1. Fix it:
  • Here we change assertThat to assertThatJson, also need to add a dependency for net.javacrumbs.json-unit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant