Skip to content

ISSUE #1039: BKClient tests with BookieErrors#1040

Closed
reddycharan wants to merge 2 commits intoapache:masterfrom
reddycharan:bookkeeperclienttests
Closed

ISSUE #1039: BKClient tests with BookieErrors#1040
reddycharan wants to merge 2 commits intoapache:masterfrom
reddycharan:bookkeeperclienttests

Conversation

@reddycharan
Copy link
Contributor

@reddycharan reddycharan commented Jan 22, 2018

Descriptions of the changes in this PR:

  • end-to-end tests for validating BKClient readEntry
    calls incase of combination of bookie timeouts and
    data corruption

Master Issue: #1039

- end-to-end tests for validating BKClient readEntry
calls incase of combination of bookie timeouts and
data corruption
@reddycharan reddycharan force-pushed the bookkeeperclienttests branch from 8dfb465 to 1b2b5ec Compare January 22, 2018 23:58
@sijie
Copy link
Member

sijie commented Jan 23, 2018

@reddycharan just one general comment (not related to this PR): it would be good if you could spend some time updating the description when you sent the PR (e.g. move the description down to below "Descriptions of the changes in this PR" and update the master issue). so the merge script can have a better commit message.

Copy link
Member

@sijie sijie left a comment

Choose a reason for hiding this comment

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

overall the change looks good to me. one comment that I would suggest to just test with one digest type.

/**
* Test the bookkeeper client with errors from Bookies.
*/
public class BookKeeperClientTestsWithBookieErrors extends BaseTestCase {
Copy link
Member

Choose a reason for hiding this comment

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

I think it is good enough to test one time of digest type, because the test is focusing on testing bookie errors not different implementation of digest types. we unnecessarily increases the number of duplicated test cases to run, which increase the possibility of flakiness and also the testing time.

so I would suggest just test with CRC32 (or even just CRC32C), which is the commonly used.

Copy link
Contributor Author

@reddycharan reddycharan Jan 23, 2018

Choose a reason for hiding this comment

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

hmm..i thought about it. But in this testsuite, for few testcases I'm corrupting data. So I would like to make sure digest error is observed in both the digestmanagers cases. It is kind of end-to-end negative scenario for various digestmanagers.

Copy link
Member

Choose a reason for hiding this comment

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

well. I think the point if you are testing digest manager cases, you should just test the digest manager, you don't need to involve other components. if you are testing end-to-end, you should just use one digest manager. remember all the digest manager are implementing same interface, there is no need to test different digest manager end-to-end.

I would suggest splitting the test case into two.

  1. you can test corrupting data on various digest managers, without involving other components.
  2. you can test end-to-end using one digest type.

@reddycharan
Copy link
Contributor Author

reddycharan commented Jan 23, 2018

@sijie will be mindful about PR description from now on. The last couple of PRs are for just testcases, so I didn't have much to mention in all of the sections.

If you agree with my explanation for DigestType paramaterized test class, I guess this commit should be good to go.

@sijie
Copy link
Member

sijie commented Jan 23, 2018

@reddycharan left a comment, which I would prefer if you want parameterized tests, it should be done on digest manager only. for end-to-end testing, it would be great to just test one.

regarding the PR description, you can edit PR description any time after you sent the PR.

- removed paramterized BaseTestClass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants