Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
test(driver): fix an issue in driver.State TestClose (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Apr 11, 2024
1 parent feb730a commit e917e47
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions driver/state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,25 @@ import (

type DriverStateTestSuite struct {
testutils.ClientTestSuite
s *State
ctx context.Context
cancel context.CancelFunc
s *State
}

func (s *DriverStateTestSuite) SetupTest() {
s.ClientTestSuite.SetupTest()
state, err := New(context.Background(), s.RPCClient)
s.ctx, s.cancel = context.WithCancel(context.Background())
state, err := New(s.ctx, s.RPCClient)
s.Nil(err)
s.s = state
}

func (s *DriverStateTestSuite) TearDownTest() {
if s.ctx.Err() == nil {
s.cancel()
}
}

func (s *DriverStateTestSuite) TestGetL1Head() {
l1Head := s.s.GetL1Head()
s.NotNil(l1Head)
Expand All @@ -34,6 +43,7 @@ func (s *DriverStateTestSuite) TestGetHeadBlockID() {
}

func (s *DriverStateTestSuite) TestClose() {
s.cancel()
s.NotPanics(s.s.Close)
}

Expand Down

0 comments on commit e917e47

Please sign in to comment.