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 ClientRetrieve with CAR exporting & add test coverage #1472

Merged
merged 1 commit into from
Mar 31, 2020
Merged

fix ClientRetrieve with CAR exporting & add test coverage #1472

merged 1 commit into from
Mar 31, 2020

Conversation

jsign
Copy link
Contributor

@jsign jsign commented Mar 30, 2020

While retrieving data with IsCAR flag enabled, the miner fails with messages no such file or directory. I extended the TestDealFlow test to cover this scenario, so it can be used to reproduce the problem, and check that it's working correctly too.

To reproduce the problem, take this PR branch, revert the client.go change and run the test.
Output:

~/code/lotus jsign/testnet3/badfiledescriptor ❯ go test ./node -run TestAPIDealFlow$  
...
...
--- FAIL: TestAPIDealFlow (6.79s)
    --- FAIL: TestAPIDealFlow/WithExportedCAR (3.31s)
        deals.go:147: open /var/folders/f1/m0gxrgsx7kg53w82gndwr4mc0000gn/T/lotus-retrieve-test-360081011/ret: no such file or directory
FAIL
FAIL    github.com/filecoin-project/lotus/node  7.312s
FAIL

Of course, with the client.go fix test pass.

The problem is the os.Open call, which opens a file in read-only mode when the main intention is writing to a file.

cc @hannahhoward

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
@hannahhoward
Copy link
Contributor

+1 I encourage merging this -- LGTM by me

@whyrusleeping
Copy link
Member

Thanks @jsign !

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