Skip to content

Commit

Permalink
Add listener graceful termination period and background context after…
Browse files Browse the repository at this point in the history
… the message is received (#3187)
  • Loading branch information
nikola-jokic authored Jan 25, 2024
1 parent 728f05c commit f7b6ad9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/ghalistener/listener/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ func TestListener_Listen(t *testing.T) {
}
client.On("CreateMessageSession", ctx, mock.Anything, mock.Anything).Return(session, nil).Once()
client.On("DeleteMessageSession", mock.Anything, session.RunnerScaleSet.Id, session.SessionId).Return(nil).Once()

config.Client = client

l, err := New(config)
Expand Down Expand Up @@ -463,6 +464,7 @@ func TestListener_Listen(t *testing.T) {
Statistics: &actions.RunnerScaleSetStatistic{},
}
client.On("CreateMessageSession", ctx, mock.Anything, mock.Anything).Return(session, nil).Once()
client.On("DeleteMessageSession", mock.Anything, session.RunnerScaleSet.Id, session.SessionId).Return(nil).Once()

msg := &actions.RunnerScaleSetMessage{
MessageId: 1,
Expand Down
1 change: 1 addition & 0 deletions cmd/ghalistener/listener/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func TestInitialMetrics(t *testing.T) {

client := listenermocks.NewClient(t)
client.On("CreateMessageSession", mock.Anything, mock.Anything, mock.Anything).Return(session, nil).Once()
client.On("DeleteMessageSession", mock.Anything, session.RunnerScaleSet.Id, session.SessionId).Return(nil).Once()
config.Client = client

handler := listenermocks.NewHandler(t)
Expand Down

0 comments on commit f7b6ad9

Please sign in to comment.