Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go tests: run in Github Actions, and make the sync tests reliable #32

Merged
merged 3 commits into from
Mar 21, 2023

Conversation

wojas
Copy link
Member

@wojas wojas commented Mar 17, 2023

Run Go tests in Github Actions.

To make the tests pass consistently:

Explicitly pass the lmdb.Env to the syncer, so that we have more control
over its lifetime and avoid opening and closing it multiple times, which
can cause crashes in the LMDB C code.

Rewrite the sync tests to wait for expected values, instead of relying
on arbitrary sleeps that make the test flaky and slow.

Do not close the lmdb.Env in the sync tests, because for some reason it
causes random SEGFAULTs on Linux (not on macOS).

Upgrade golangci-lint for Go 1.20

wojas added 2 commits March 17, 2023 15:37
Explicitly pass the lmdb.Env to the syncer, so that we have more control
over its lifetime and avoid opening and closing it multiple times, which
can cause crashes in the LMDB C code.

Rewrite the sync tests to wait for expected values, instead of relying
on arbitrary sleeps that make the test flaky and slow.

Do not close the lmdb.Env in the sync tests, because for some reason it
causes random SEGFAULTs on Linux (not on macOS).
@wojas wojas changed the title Github Actions: Go tests Go tests: run in Github Actions, and make the sync tests reliable Mar 21, 2023
@wojas wojas added this to the v0.3.1 milestone Mar 21, 2023
@wojas wojas requested a review from nvaatstra March 21, 2023 09:10
@nvaatstra
Copy link
Contributor

Good changes & nice to have the tests included.

Only concern is the S3 testing, which is skipped:

* MinIO not running in Docker Compose, skipping S3 tests

Perhaps not suitable for this PR, but for a future improvement: Can we have the GH Action prep a minio server to allow for the tests to also include the S3-backed usecases?

@wojas
Copy link
Member Author

wojas commented Mar 21, 2023

Perhaps not suitable for this PR, but for a future improvement: Can we have the GH Action prep a minio server to allow for the tests to also include the S3-backed usecases?

Good point, added #36 for this.

@wojas wojas merged commit 1ccf127 into main Mar 21, 2023
@wojas wojas deleted the github-action-go-tests branch March 21, 2023 12:25
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