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 UT readMultipleFiles in LocalCacheFileInStreamTest #18168

Conversation

jasondrogba
Copy link
Contributor

What changes are proposed in this pull request?

Added a modification to the code in the LocalCacheFileInStreamTest class.Specifically, the code change addresses an issue with the readMultipleFiles unit test in the LocalCacheFileInStreamTest.
The proposed change to fix this issue is to add the setUfsPath method within the generateURIStatus method and set it to be identical to the Path. This ensures that the UfsPath is properly set for each file, allowing the readMultipleFiles test to pass successfully.

Why are the changes needed?

The changes in this pull request are needed because they address a specific issue with the LocalCacheFileInStreamTest class's readMultipleFiles unit test.
The readMultipleFiles unit test was failing because it relied on the correct calculation of FieldId in Dora, which is based on the UfsPath. However, in this test, the UfsPath for files was not being set and remained empty, leading to all files having the same FieldId after hash calculation.
The absence of a proper UfsPath for files in the test class caused multiple files to share the same FieldId, causing them to read data from a single file instead of their respective files.
To resolve this issue, the proposed solution is to set the UfsPath within the generateURIStatus method to be identical to the Path. This ensures that each file has a distinct and properly set UfsPath, allowing the readMultipleFiles test to pass without affecting other unit tests.

Does this PR introduce any user facing changes?

Please list the user-facing changes introduced by your change, including

  1. change in user-facing APIs
  2. addition or removal of property keys
  3. webui

@alluxio-bot
Copy link
Contributor

Automated checks report:

  • PR title follows the conventions: FAIL
    • The title of the PR does not pass all the checks. Please fix the following issues:
      • First word must be capitalized
  • Commits associated with Github account: PASS

Some checks failed. Please fix the reported issues and reply 'alluxio-bot, check this please' to re-run checks.

@jasondrogba jasondrogba changed the title fix UT readMultipleFiles in LocalCacheFileInStreamTest Fix UT readMultipleFiles in LocalCacheFileInStreamTest Sep 19, 2023
@alluxio-bot
Copy link
Contributor

Automated checks report:

  • PR title follows the conventions: PASS
  • Commits associated with Github account: PASS

All checks passed!

Copy link
Contributor

@dbw9580 dbw9580 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing this!

@apc999 apc999 force-pushed the main branch 2 times, most recently from 2fec0ec to b597c61 Compare October 17, 2023 19:11
@jiacheliu3 jiacheliu3 added type-bug This issue is about a bug type-code-quality code quality improvement labels Nov 6, 2023
@jiacheliu3
Copy link
Contributor

alluxio-bot, merge this please

@alluxio-bot alluxio-bot merged commit c7c0820 into Alluxio:main Nov 6, 2023
12 checks passed
ssz1997 pushed a commit to ssz1997/alluxio that referenced this pull request Dec 15, 2023
### What changes are proposed in this pull request?

Added a modification to the code in the LocalCacheFileInStreamTest class.Specifically, the code change addresses an issue with the readMultipleFiles unit test in the LocalCacheFileInStreamTest.
The proposed change to fix this issue is to add the setUfsPath method within the generateURIStatus method and set it to be identical to the Path. This ensures that the UfsPath is properly set for each file, allowing the readMultipleFiles test to pass successfully.

### Why are the changes needed?

The changes in this pull request are needed because they address a specific issue with the LocalCacheFileInStreamTest class's readMultipleFiles unit test.
The readMultipleFiles unit test was failing because it relied on the correct calculation of FieldId in Dora, which is based on the UfsPath. However, in this test, the UfsPath for files was not being set and remained empty, leading to all files having the same FieldId after hash calculation.
The absence of a proper UfsPath for files in the test class caused multiple files to share the same FieldId, causing them to read data from a single file instead of their respective files.
To resolve this issue, the proposed solution is to set the UfsPath within the generateURIStatus method to be identical to the Path. This ensures that each file has a distinct and properly set UfsPath, allowing the readMultipleFiles test to pass without affecting other unit tests.

### Does this PR introduce any user facing changes?

Please list the user-facing changes introduced by your change, including
  1. change in user-facing APIs
  2. addition or removal of property keys
  3. webui

			pr-link: Alluxio#18168
			change-id: cid-422d5b4eb8bd94b044dbae9181dfc91810e300ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug This issue is about a bug type-code-quality code quality improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants