teamhanko / hanko

Authentication and user management system optimized for passkeys

Home Page:https://hanko.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to start Email Server from test suite in parallel

irby opened this issue · comments

Checklist

  • I could not find a solution in the existing issues or docs.
  • I agree to follow this project's Code of Conduct.

Describe the bug

Currently, we only have a single test suite that requires an email server, passcode_test.

For #1030 , this work will require multiple test suites to rely on an email server. The test suite setup and tear down is responsible for starting and stopping the mock email server, respectively. I've been running into problems where running multiple test suites in parallel ends up causing failures because tests cannot start / connect to the mock email server because another test suite has started / stopped it.

Reproducing the bug

Have 2 or more test suites setup with WithEmailServer set to true, and with tests that handle sending an email out.

Logs

No response

Configuration

No response

Hanko Version

0.8.3

OS Hanko Backend

None

OS Version Hanko Backend

No response

OS

None

OS Version

No response

Browser Version

No response

Environment

None

Additional Context

No response

@FlxMgdnz @like-a-bause What are your thoughts on refactoring the unit tests that rely on a email server to use a Mailslurper instance? I can create an abstraction that interacts with Mailslurper's API and use it within my tests to fetch emails / clear emails.

I think this will come to our advantage to make it easier to inspect emails sent to the server and verify the content within.

This would likely require the Docker container be started before tests are run, and then spin this instance down after tests complete.

Thanks @irby. Sounds good to me.

@lfleischmann any thoughts?

@lfleischmann any thoughts?

No. Sounds resonable.