-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
code healthM-T: Test improvements and anything that improves code healthM-T: Test improvements and anything that improves code health
Description
Summary
A recent test run on main failed for reasons unrelated to the recent commit. Perhaps a timing of a poll?
The retry succeeded! 🧪 ✨
Preview
🔗 https://github.com/slackapi/slack-cli/actions/runs/23178071163/job/67344594805
=== RUN TestPlatformActivity_StreamingLogs/should_return_nil_if_TailArg_is_set_and_activity_request_fails_while_polling
activity_test.go:267:
Error Trace: /Users/runner/work/slack-cli/slack-cli/internal/pkg/platform/activity_test.go:267
/Users/runner/work/slack-cli/slack-cli/internal/pkg/platform/activity_test.go:296
Error: Not equal:
expected: 3
actual : 4
Test: TestPlatformActivity_StreamingLogs/should_return_nil_if_TailArg_is_set_and_activity_request_fails_while_polling
Messages: Expected number of calls (3) of method Activity does not match the actual number of calls (4).
slack-cli/internal/pkg/platform/activity_test.go
Lines 249 to 269 in f23e6d3
| "should return nil if TailArg is set and activity request fails while polling": { | |
| Args: types.ActivityArgs{ | |
| TailArg: true, | |
| IdleTimeoutM: 1, | |
| PollingIntervalMS: 20, // poll activity every 20 ms | |
| }, | |
| Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock) context.Context { | |
| cm.API.On("Activity", mock.Anything, mock.Anything, mock.Anything).Return(api.ActivityResult{}, slackerror.New("mock_broken_logs")) | |
| ctx, cancel := context.WithCancel(ctx) | |
| go func() { | |
| time.Sleep(time.Millisecond * 50) // cancel activity in 50 ms | |
| cancel() | |
| }() | |
| return ctx | |
| }, | |
| ExpectedError: nil, | |
| ExpectedAsserts: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock) { | |
| // with the above polling/canceling setup, expectation is activity called three times. | |
| cm.API.AssertNumberOfCalls(t, "Activity", 3) | |
| }, | |
| }, |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
code healthM-T: Test improvements and anything that improves code healthM-T: Test improvements and anything that improves code health