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

✅(backend) fix flaky tests #279

Merged
merged 2 commits into from
Sep 24, 2024
Merged

✅(backend) fix flaky tests #279

merged 2 commits into from
Sep 24, 2024

Conversation

AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented Sep 23, 2024

Purpose

  • ✅(backend) fix flaky test on tmp file:
    It seems to have a race condition, sometimes the tmp file is not deleted before the test assertion. We let the test sleep for 0.5 second before the assertion.

  • ✅(CI) fix flaky test on Minio initialized:
    Minio server need to be initialized before running the job to configure Minio.
    We add a delay to wait for Minio server to be ready.

It seems to have a race condition, sometimes the
tmp file is not deleted before the test assertion.
We let the test sleep for 0.5 second before
the assertion.
@AntoLC AntoLC added bug Something isn't working python Pull requests that update Python code backend labels Sep 23, 2024
@AntoLC AntoLC self-assigned this Sep 23, 2024
@AntoLC AntoLC changed the title ✅(backend) fix flaky test on tmp file ✅(backend) fix flaky tests Sep 23, 2024
@@ -178,6 +178,9 @@ jobs:
-v /data/media:/data \
minio/minio server --console-address :9001 /data

- name: Add delay to wait for Minio to start correctly
run: sleep 5
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use something like this to avoid wasting time?
https://github.com/openfun/joanie/blob/main/.circleci/config.yml#L227

MinIO server need to be initialized before
running the job to configure MinIO.
We add a delay to wait for MinIO server to be ready.
@AntoLC AntoLC enabled auto-merge (rebase) September 24, 2024 07:36
@AntoLC AntoLC merged commit 4507903 into main Sep 24, 2024
14 of 16 checks passed
@AntoLC AntoLC deleted the fix/flaky-test branch September 24, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants