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 flaky test #1

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

Fix flaky test #1

wants to merge 22 commits into from

Conversation

prathyushreddylpr
Copy link
Owner

@prathyushreddylpr prathyushreddylpr commented Sep 26, 2023

Description
Fixed the flaky test withTextValuesMap inside the StandardImageMetadataSupportTest class.

Root Cause
The test withTextValuesMap has been reported as flaky when run with the NonDex tool. The test failed because it is trying to compare the keys and values of a Map(entries) with that of the values in a NodeList. The values of the map are hardcoded in the code and compared with those of the values in NodeList. But the Map is initialized to be a HashMap and the HashMap in Java is implemented in such a way that it does not store the order in which the keys and values are inserted.

Fix
This test is fixed by replacing the HashMap with LinkedHashMap. The order in which the elements are entered is preserved inside LinkedHashMap, so when we compare the values with those of in NodeList(textEntries) the test runs as expected.

How this has been tested?

Java: openjdk version "11.0.20.1"
Maven: Apache Maven 3.6.3

  1. Module build - Successful
    Command used -
mvn install -pl infra/common -am -DskipTests
  1. Regular test - Successful
    Command used -
mvn -pl imageio/imageio-core test -Dtest=com.twelvemonkeys.imageio.StandardImageMetadataSupportTest#withTextValuesMap
  1. NonDex test - Failed
    Command used -
mvn -pl imageio/imageio-core edu.illinois:nondex-maven-plugin:2.1.1:nondex -Dtest=com.twelvemonkeys.imageio.StandardImageMetadataSupportTest#withTextValuesMap

NonDex test passed after the fix.

lakkidi2 and others added 2 commits September 26, 2023 12:42
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.8 to 2.21.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@6a28655...ddccb87)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@CaseyPan
Copy link

LGTM. One suggestion to consider is either removing the screenshots or providing additional information about the NonDex testing tool for reference.

dependabot bot and others added 19 commits October 2, 2023 11:51
Bumps [mikepenz/action-junit-report](https://github.com/mikepenz/action-junit-report) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/mikepenz/action-junit-report/releases)
- [Commits](mikepenz/action-junit-report@75b84e7...0a8a5ba)

---
updated-dependencies:
- dependency-name: mikepenz/action-junit-report
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps commons-io:commons-io from 2.13.0 to 2.14.0.

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.8 to 2.21.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v2.21.8...ddccb87)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
…eloader to the imageio-jpeg MANIFEST.MF

This is to make it possible to load the SPI plugin in OSGi.
@zzjas
Copy link

zzjas commented Oct 5, 2023

Please address the same comment at prathyushreddylpr/druid#1

@prathyushreddylpr
Copy link
Owner Author

LGTM. One suggestion to consider is either removing the screenshots or providing additional information about the NonDex testing tool for reference.

Updated

@prathyushreddylpr
Copy link
Owner Author

Please address the same comment at prathyushreddylpr/druid#1

Updated

@zzjas
Copy link

zzjas commented Oct 6, 2023

You can proceed to open a real PR. Once you open a real PR, please mark this tentative PR as Opened in your tentative_pr.csv file and also raise a PR to IDoFT marking this as Opened. Thanks!

@zzjas
Copy link

zzjas commented Oct 17, 2023

Have you opened a real PR for this? If so, please mark this as "Opened" in your tentative_pr.csv file and also raise a PR to IDoFT marking this as Opened. Thanks!

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.

6 participants