Skip to content

Commit

Permalink
fix: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tochemey committed Oct 16, 2023
1 parent ae99473 commit 506fbb7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ func (entity *actor[T]) processCommandAndReply(ctx actors.ReceiveContext, comman
if event == nil {
// get the current state and marshal it
resultingState, _ := anypb.New(entity.currentState)
// create the command reply to send out
reply := &egopb.CommandReply{
Reply: &egopb.CommandReply_StateReply{
StateReply: &egopb.StateReply{
Expand Down
4 changes: 3 additions & 1 deletion actor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ func TestActor(t *testing.T) {
assert.NoError(t, err)
})
t.Run("with no event to persist", func(t *testing.T) {
defer goleak.VerifyNone(t)
ctx := context.TODO()

// create an actor system
actorSystem, err := actors.NewActorSystem("TestActorSystem",
actors.WithPassivationDisabled(),
Expand Down Expand Up @@ -431,6 +431,7 @@ func TestActor(t *testing.T) {
err = state.StateReply.GetState().UnmarshalTo(resultingState)
require.NoError(t, err)

// create the expected response
expected := &testpb.Account{
AccountId: persistenceID,
AccountBalance: 500.00,
Expand Down Expand Up @@ -466,6 +467,7 @@ func TestActor(t *testing.T) {

// test no events to persist
command = new(testpb.TestNoEvent)
// send a command
reply, err = actors.Ask(ctx, pid, command, 5*time.Second)
require.NoError(t, err)
require.NotNil(t, reply)
Expand Down
1 change: 1 addition & 0 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,6 @@ func (x *Engine) Stop(ctx context.Context) error {
}
}
}
// stop the actor system and return the possible error
return x.actorSystem.Stop(ctx)
}

0 comments on commit 506fbb7

Please sign in to comment.