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

RATIS-1680. TestLeaderInstallSnapshot creates untracked files #719

Merged
merged 1 commit into from
Aug 18, 2022

Conversation

adoroszlai
Copy link
Contributor

What changes were proposed in this pull request?

TestLeaderInstallSnapshot leaves untracked files in ratis-test/snapshot directory.

$ mvn clean test -DfailIfNoTests=false -Dtest=TestLeaderInstallSnapshot
...
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

	ratis-test/snapshot/

nothing added to commit but untracked files present (use "git add" to track)

$ find ratis-test/snapshot | sort
ratis-test/snapshot
ratis-test/snapshot/1.bin
ratis-test/snapshot/sub
ratis-test/snapshot/sub/2.bin

The root cause is that getSMdir() returns null until storage is initialized.

https://issues.apache.org/jira/browse/RATIS-1680

How was this patch tested?

$ mvn clean test -DfailIfNoTests=false -Dtest=TestLeaderInstallSnapshot
...
$ git status
On branch RATIS-1680

nothing to commit, working tree clean

Regular CI:
https://github.com/adoroszlai/incubator-ratis/actions/runs/2882163120

@adoroszlai adoroszlai self-assigned this Aug 18, 2022
Copy link
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

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

+1 the change looks good.

Checked it manually. The extra files are in the individual directories.

$find ratis-test/ -name 1.bin
ratis-test//target/test/data/a248a6c8/MiniRaftClusterWithGrpc20890651/s2/06b4977b-37ee-46a9-90bf-f0c8c77cbb49/sm/snapshot/1.bin
ratis-test//target/test/data/a248a6c8/MiniRaftClusterWithGrpc20890651/s1/06b4977b-37ee-46a9-90bf-f0c8c77cbb49/sm/snapshot/1.bin
ratis-test//target/test/data/a248a6c8/MiniRaftClusterWithGrpc20890651/s0/06b4977b-37ee-46a9-90bf-f0c8c77cbb49/sm/snapshot/1.bin
ratis-test//target/test/data/a248a6c8/MiniRaftClusterWithGrpca918d41b/s2/a253e4e5-f13e-42b2-8bc3-039d0995cca3/sm/snapshot/1.bin
ratis-test//target/test/data/a248a6c8/MiniRaftClusterWithGrpca918d41b/s1/a253e4e5-f13e-42b2-8bc3-039d0995cca3/sm/snapshot/1.bin
ratis-test//target/test/data/a248a6c8/MiniRaftClusterWithGrpca918d41b/s0/a253e4e5-f13e-42b2-8bc3-039d0995cca3/sm/snapshot/1.bin

@szetszwo szetszwo merged commit 971e547 into apache:master Aug 18, 2022
@adoroszlai adoroszlai deleted the RATIS-1680 branch August 18, 2022 17:37
@adoroszlai
Copy link
Contributor Author

Thanks @szetszwo for reviewing and committing it.

codings-dan pushed a commit that referenced this pull request Aug 22, 2022
symious pushed a commit to symious/ratis that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants