-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
ZOOKEEPER-4232: InvalidSnapshotTest corrupts its own test data #1627
Closed
ztzg
wants to merge
2
commits into
apache:branch-3.7
from
ztzg:ZOOKEEPER-4232-invalid-snapshot-is-invalid-x-3.7
Closed
ZOOKEEPER-4232: InvalidSnapshotTest corrupts its own test data #1627
ztzg
wants to merge
2
commits into
apache:branch-3.7
from
ztzg:ZOOKEEPER-4232-invalid-snapshot-is-invalid-x-3.7
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Without this, the ZooKeeperServer "fixes" the 'snapshot.83f' reference file, which: 1. Makes the test ineffective after the first run; 2. Causes the file to show as modified in version control tools; 3. Can end up committed by accident. This patch creates a temporary copy of the data directory.
"CI / mvn (full-build-cppunit-tests" failure seems not related to this PR. |
arshadmohammad
approved these changes
Mar 9, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM +1
asfgit
pushed a commit
that referenced
this pull request
Mar 9, 2021
`InvalidSnapshotTest.testSnapshot` starts an instance of `ZooKeeperServer` on the version-controlled `resources/data/invalidsnap` directory, which, as a side-effect, \"fixes\" the following snapshot—which was broken on purpose (see ZOOKEEPER-367): `zookeeper-server/src/test/resources/data/invalidsnap/version-2/snapshot.83f` This status quo creates a number of problems: 1. It makes the test ineffective after the first run; 2. The file shows as modified in version control tools, which can be annoying; 3. The \"fixed\" snapshot can end up being committed by mistake, invalidating the test. (\#3 is not theoretical; that \"fixed\" snapshot frequently shows up in pull requests, and was recently merged into `master`.) Author: Damien Diederen <dd@crosstwine.com> Reviewers: Mohammad Arshad <arshad@apache.org> Closes #1627 from ztzg/ZOOKEEPER-4232-invalid-snapshot-is-invalid-x-3.7 and squashes the following commits: c18a895 [Damien Diederen] ZOOKEEPER-4232: Ensure that ZOOKEEPER-367 test data fails to parse 42a5a0b [Damien Diederen] ZOOKEEPER-4232: Run InvalidSnapshotTest on a copy of test data
asfgit
pushed a commit
that referenced
this pull request
Mar 9, 2021
`InvalidSnapshotTest.testSnapshot` starts an instance of `ZooKeeperServer` on the version-controlled `resources/data/invalidsnap` directory, which, as a side-effect, \"fixes\" the following snapshot—which was broken on purpose (see ZOOKEEPER-367): `zookeeper-server/src/test/resources/data/invalidsnap/version-2/snapshot.83f` This status quo creates a number of problems: 1. It makes the test ineffective after the first run; 2. The file shows as modified in version control tools, which can be annoying; 3. The \"fixed\" snapshot can end up being committed by mistake, invalidating the test. (\#3 is not theoretical; that \"fixed\" snapshot frequently shows up in pull requests, and was recently merged into `master`.) Author: Damien Diederen <dd@crosstwine.com> Reviewers: Mohammad Arshad <arshad@apache.org> Closes #1627 from ztzg/ZOOKEEPER-4232-invalid-snapshot-is-invalid-x-3.7 and squashes the following commits: c18a895 [Damien Diederen] ZOOKEEPER-4232: Ensure that ZOOKEEPER-367 test data fails to parse 42a5a0b [Damien Diederen] ZOOKEEPER-4232: Run InvalidSnapshotTest on a copy of test data (cherry picked from commit 4a19dd1) Signed-off-by: Mohammad Arshad <arshad@apache.org>
Merged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
InvalidSnapshotTest.testSnapshot
starts an instance ofZooKeeperServer
on the version-controlledresources/data/invalidsnap
directory, which, as a side-effect, "fixes" the following
snapshot—which was broken on purpose (see ZOOKEEPER-367):
zookeeper-server/src/test/resources/data/invalidsnap/version-2/snapshot.83f
This status quo creates a number of problems:
annoying;
invalidating the test.
(#3 is not theoretical; that "fixed" snapshot frequently shows up in
pull requests, and was recently merged into
master
.)