René's URL Explorer Experiment


Title: fix: flakiness in org.json.junit.JSONObjectTest#valueToString by hofi1 · Pull Request #2 · hofi1/JSON-java · GitHub

Open Graph Title: fix: flakiness in org.json.junit.JSONObjectTest#valueToString by hofi1 · Pull Request #2 · hofi1/JSON-java

X Title: fix: flakiness in org.json.junit.JSONObjectTest#valueToString by hofi1 · Pull Request #2 · hofi1/JSON-java

Description: Problem: The string in the assertion can change, because the Map which is used to store the data in the JSONObject returns the data in non-deterministic order (the order of child elements in JSON strings do not matter, and JSON strings are equal regardless of the ordering of the elements on the same hierarchy level) The flaky test was found by using the NonDex tool. The flakiness was discovered on the following lines JSON-java/src/test/java/org/json/junit/JSONObjectTest.java Lines 2028 to 2029 in 01727fd assertTrue("jsonObject valueToString() incorrect", JSONObject.valueToString(jsonObject).equals(jsonObject.toString())); as well as JSON-java/src/test/java/org/json/junit/JSONObjectTest.java Lines 2039 to 2040 in 01727fd assertTrue("map valueToString() incorrect", jsonObject.toString().equals(JSONObject.valueToString(map))); Solution: Changed the assert statement from a JUnit Assertion to a JSON Assertion, so the strings are not compared charwise but are compared the way as specified for JSON strings (not taking care of the order of the elements on the same level). The JSONAssertion library was chosen because it provides general assertions to compare JSON strings without the need of writing complex JUnit Assertions, what would need a lot of work to convert the strings in a different data structure, a lot of boilerplate code as well as the chance of adding more errors than fixing. Result: The test is deterministic and not flaky. This improves the quality of the test and reduces the time to search for the bug during future development. Reproduce: mvn edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=org.json.junit.JSONObjectTest#valueToString

Open Graph Description: Problem: The string in the assertion can change, because the Map which is used to store the data in the JSONObject returns the data in non-deterministic order (the order of child elements in JSON ...

X Description: Problem: The string in the assertion can change, because the Map which is used to store the data in the JSONObject returns the data in non-deterministic order (the order of child elements in JSON ...

Opengraph URL: https://github.com/hofi1/JSON-java/pull/2

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:7d613c64-2dcc-c368-65dc-42415051f6f0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD790:161EE9:1744104:2085C80:6A61C90C
html-safe-nonce00d856a3ee7224cdf4c50b28fb2f768c39f716b49b1647a58276c533e3cf98ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzkwOjE2MUVFOToxNzQ0MTA0OjIwODVDODA6NkE2MUM5MEMiLCJ2aXNpdG9yX2lkIjoiNjQ1ODU4NzYyMzI0NzE2OTgwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf09f18930e2424d65c22706019b071ddb7f156a03c58b2fd881f4134495a3169
hovercard-subject-tagpull_request:1521883626
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/hofi1/JSON-java/pull/2/files
twitter:imagehttps://avatars.githubusercontent.com/u/61789910?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/61789910?s=400&v=4
og:image:altProblem: The string in the assertion can change, because the Map which is used to store the data in the JSONObject returns the data in non-deterministic order (the order of child elements in JSON ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None6f4633bcf01c1ad14b73fd07dd39ac31d61f3d3c2578ee08ec1792b7b351eeb9
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/hofi1/JSON-java git https://github.com/hofi1/JSON-java.git
octolytics-dimension-user_id61789910
octolytics-dimension-user_loginhofi1
octolytics-dimension-repository_id693387470
octolytics-dimension-repository_nwohofi1/JSON-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id1187853
octolytics-dimension-repository_parent_nwostleary/JSON-java
octolytics-dimension-repository_network_root_id1187853
octolytics-dimension-repository_network_root_nwostleary/JSON-java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseac296ae7f21856f1f92adbad22f870b6fbb4b907
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/hofi1/JSON-java/pull/2/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhofi1%2FJSON-java%2Fpull%2F2%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fhofi1%2FJSON-java%2Fpull%2F2%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=hofi1%2FJSON-java
Reloadhttps://github.com/hofi1/JSON-java/pull/2/files
Reloadhttps://github.com/hofi1/JSON-java/pull/2/files
Reloadhttps://github.com/hofi1/JSON-java/pull/2/files
hofi1 https://github.com/hofi1
JSON-javahttps://github.com/hofi1/JSON-java
stleary/JSON-javahttps://github.com/stleary/JSON-java
Notifications https://github.com/login?return_to=%2Fhofi1%2FJSON-java
Fork 0 https://github.com/login?return_to=%2Fhofi1%2FJSON-java
Star 0 https://github.com/login?return_to=%2Fhofi1%2FJSON-java
Code https://github.com/hofi1/JSON-java
Pull requests 3 https://github.com/hofi1/JSON-java/pulls
Actions https://github.com/hofi1/JSON-java/actions
Projects https://github.com/hofi1/JSON-java/projects
Security and quality 0 https://github.com/hofi1/JSON-java/security
Insights https://github.com/hofi1/JSON-java/pulse
Code https://github.com/hofi1/JSON-java
Pull requests https://github.com/hofi1/JSON-java/pulls
Actions https://github.com/hofi1/JSON-java/actions
Projects https://github.com/hofi1/JSON-java/projects
Security and quality https://github.com/hofi1/JSON-java/security
Insights https://github.com/hofi1/JSON-java/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fhofi1%2FJSON-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fhofi1%2FJSON-java%2Fissues%2Fnew%2Fchoose
hofi1https://github.com/hofi1
masterhttps://github.com/hofi1/JSON-java/tree/master
bugfix/fix-flakyness-org.json.junit.JSONObjectTest#valueToStringhttps://github.com/hofi1/JSON-java/tree/bugfix/fix-flakyness-org.json.junit.JSONObjectTest%23valueToString
Conversation 3 https://github.com/hofi1/JSON-java/pull/2
Commits 1 https://github.com/hofi1/JSON-java/pull/2/commits
Checks 0 https://github.com/hofi1/JSON-java/pull/2/checks
Files changed https://github.com/hofi1/JSON-java/pull/2/files
Please reload this pagehttps://github.com/hofi1/JSON-java/pull/2/files
fix: flakiness in org.json.junit.JSONObjectTest#valueToString https://github.com/hofi1/JSON-java/pull/2/files#top
Show all changes 1 commit https://github.com/hofi1/JSON-java/pull/2/files
ca88454 fix: flakiness in org.json.junit.JSONObjectTest#valueToString Sep 19, 2023 https://github.com/hofi1/JSON-java/pull/2/commits/ca88454f1cdaedf46bcce546c0a9ce79709c544c
Clear filters https://github.com/hofi1/JSON-java/pull/2/files
Please reload this pagehttps://github.com/hofi1/JSON-java/pull/2/files
Please reload this pagehttps://github.com/hofi1/JSON-java/pull/2/files
build.gradle https://github.com/hofi1/JSON-java/pull/2/files#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7
pom.xml https://github.com/hofi1/JSON-java/pull/2/files#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8
JSONObjectTest.java https://github.com/hofi1/JSON-java/pull/2/files#diff-44caf7c2d0dfa560c6786c818cd109f6e891474ea8e1226bf08a583282160325
build.gradlehttps://github.com/hofi1/JSON-java/pull/2/files#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7
View file https://github.com/hofi1/JSON-java/blob/ca88454f1cdaedf46bcce546c0a9ce79709c544c/build.gradle
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/hofi1/JSON-java/pull/2/{{ revealButtonHref }}
https://github.com/hofi1/JSON-java/pull/2/files#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7
https://github.com/hofi1/JSON-java/pull/2/files#diff-49a96e7eea8a94af862798a45174e6ac43eb4f8b4bd40759b5da63ba31ec3ef7
pom.xmlhttps://github.com/hofi1/JSON-java/pull/2/files#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8
View file https://github.com/hofi1/JSON-java/blob/ca88454f1cdaedf46bcce546c0a9ce79709c544c/pom.xml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/hofi1/JSON-java/pull/2/{{ revealButtonHref }}
https://github.com/hofi1/JSON-java/pull/2/files#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8
https://github.com/hofi1/JSON-java/pull/2/files#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8
src/test/java/org/json/junit/JSONObjectTest.javahttps://github.com/hofi1/JSON-java/pull/2/files#diff-44caf7c2d0dfa560c6786c818cd109f6e891474ea8e1226bf08a583282160325
View file https://github.com/hofi1/JSON-java/blob/ca88454f1cdaedf46bcce546c0a9ce79709c544c/src/test/java/org/json/junit/JSONObjectTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/hofi1/JSON-java/pull/2/{{ revealButtonHref }}
https://github.com/hofi1/JSON-java/pull/2/files#diff-44caf7c2d0dfa560c6786c818cd109f6e891474ea8e1226bf08a583282160325
https://github.com/hofi1/JSON-java/pull/2/files#diff-44caf7c2d0dfa560c6786c818cd109f6e891474ea8e1226bf08a583282160325
https://github.com/hofi1/JSON-java/pull/2/files#diff-44caf7c2d0dfa560c6786c818cd109f6e891474ea8e1226bf08a583282160325
https://github.com/hofi1/JSON-java/pull/2/files#diff-44caf7c2d0dfa560c6786c818cd109f6e891474ea8e1226bf08a583282160325
https://github.com/hofi1/JSON-java/pull/2/files#diff-44caf7c2d0dfa560c6786c818cd109f6e891474ea8e1226bf08a583282160325
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.