sectorstorage: Fix TestRedoPC1
This commit is contained in:
parent
4f97d9637e
commit
2d16af6ee6
3
extern/sector-storage/manager_test.go
vendored
3
extern/sector-storage/manager_test.go
vendored
@ -198,6 +198,9 @@ func TestRedoPC1(t *testing.T) {
|
||||
_, err = m.SealPreCommit1(ctx, sid, ticket, pieces)
|
||||
require.NoError(t, err)
|
||||
|
||||
// tell mock ffi that we expect PC1 again
|
||||
require.NoError(t, tw.mockSeal.ForceState(sid, 0)) // sectorPacking
|
||||
|
||||
_, err = m.SealPreCommit1(ctx, sid, ticket, pieces)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
13
extern/sector-storage/mock/mock.go
vendored
13
extern/sector-storage/mock/mock.go
vendored
@ -127,6 +127,19 @@ func (mgr *SectorMgr) AcquireSectorNumber() (abi.SectorNumber, error) {
|
||||
return id, nil
|
||||
}
|
||||
|
||||
func (mgr *SectorMgr) ForceState(sid abi.SectorID, st int) error {
|
||||
mgr.lk.Lock()
|
||||
ss, ok := mgr.sectors[sid]
|
||||
mgr.lk.Unlock()
|
||||
if !ok {
|
||||
return xerrors.Errorf("no sector with id %d in storage", sid)
|
||||
}
|
||||
|
||||
ss.state = st
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (mgr *SectorMgr) SealPreCommit1(ctx context.Context, sid abi.SectorID, ticket abi.SealRandomness, pieces []abi.PieceInfo) (out storage.PreCommit1Out, err error) {
|
||||
mgr.lk.Lock()
|
||||
ss, ok := mgr.sectors[sid]
|
||||
|
Loading…
Reference in New Issue
Block a user