Skip to content

multi: add tatanka handler tests.#1

Open
dnldd wants to merge 2 commits intobisoncraft:masterfrom
dnldd:add-handler-tests
Open

multi: add tatanka handler tests.#1
dnldd wants to merge 2 commits intobisoncraft:masterfrom
dnldd:add-handler-tests

Conversation

@dnldd
Copy link
Copy Markdown
Contributor

@dnldd dnldd commented Feb 5, 2026

This adds tests for tatanka message handlers.

Comment thread tatanka/tatanka_test.go Outdated
Comment thread tatanka/tatanka_test.go Outdated
Comment thread tatanka/handlers_test.go Outdated
Comment on lines +186 to +187
// Give push stream handler time to register
time.Sleep(100 * time.Millisecond)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these time.Sleeps necessary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, need to wait briefly for push streams to be created before topics can be registered. I'm updating the sleeps to use requireEventually which is more flexible.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm reading this wrong, but wouldn't we want to move the response (WriteLengthPrefixedMessage) to the end of (*TatankaNode).handleClientPush to avoid the race condition altogether?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm reading this wrong, but wouldn't we want to move the response (WriteLengthPrefixedMessage) to the end of (*TatankaNode).handleClientPush to avoid the race condition altogether?

Am I wrong?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No you're not, it'd be better to move the response after the push stream is created to avoid responses arriving before the push stream registration is done.

This adds tests for tatanka message handlers.
@dnldd dnldd force-pushed the add-handler-tests branch from 03253a3 to d083730 Compare February 19, 2026 13:06
@dnldd dnldd force-pushed the add-handler-tests branch from d083730 to 5e721a2 Compare February 19, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants