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

storage: add a unit test to test RocksDB's error message is expected #26289

Merged
merged 1 commit into from
May 31, 2018

Conversation

windchan7
Copy link
Contributor

Add a unit test to test OpenFile, ReadFile, and DeleteFile in RocksDB
return os.ErrNotExist error when the file or directory is not found.

Related to: #26259.
Release note: None

@windchan7 windchan7 requested review from tbg and a team May 31, 2018 17:22
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

Thanks Victor!


// Verify DeleteFile returns os.ErrNotExist if file does not exist.
if err := db.DeleteFile("/non/existent/file"); !os.IsNotExist(err) {
t.Fatalf("expected error '%s', actual '%v'", os.ErrNotExist, err)
Copy link
Member

Choose a reason for hiding this comment

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

nit: t.Fatalf("expected IsNotExist, but got %v (%T)", err, err)

Add a unit test to test `OpenFile`, `ReadFile`, and `DeleteFile` in RocksDB
return `os.ErrNotExist` error when the file or directory is not found.

Related to: cockroachdb#26259.
Release note: None
@windchan7
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request May 31, 2018
26289: storage: add a unit test to test RocksDB's error message is expected r=windchan7 a=windchan7

Add a unit test to test `OpenFile`, `ReadFile`, and `DeleteFile` in RocksDB
return `os.ErrNotExist` error when the file or directory is not found.

Related to: #26259.
Release note: None

Co-authored-by: Victor Chen <[email protected]>
@craig
Copy link
Contributor

craig bot commented May 31, 2018

Build succeeded

@craig craig bot merged commit 23d5e62 into cockroachdb:master May 31, 2018
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.

3 participants