Skip to content

fix(test): clean big files on clean recipe#849

Closed
qlrd wants to merge 1 commit intogetfloresta:masterfrom
qlrd:fix/test-clean-data
Closed

fix(test): clean big files on clean recipe#849
qlrd wants to merge 1 commit intogetfloresta:masterfrom
qlrd:fix/test-clean-data

Conversation

@qlrd
Copy link
Copy Markdown
Contributor

@qlrd qlrd commented Feb 17, 2026

Description and Notes

This commit add a bash command to clean recipe and try to improve the clean process through some big temporary files. In some local tests, those jumped from 0 to 51G in /tmp/folder

How to verify the changes you have done?

See #848

Copy link
Copy Markdown
Collaborator

@csgui csgui left a comment

Choose a reason for hiding this comment

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

Just some NITs about scripts portability. There are constrained environments that doesn't have bash by default.

Comment thread tests/run.sh Outdated
Comment thread justfile Outdated
@Davidson-Souza Davidson-Souza added the bug Something isn't working label Feb 17, 2026
@qlrd qlrd force-pushed the fix/test-clean-data branch 4 times, most recently from 3f7379b to 34524c5 Compare February 19, 2026 13:37
@qlrd
Copy link
Copy Markdown
Contributor Author

qlrd commented Feb 19, 2026

Just some NITs about scripts portability. There are constrained environments that doesn't have bash by default.

Applied some POSIX procedures on tests/run.sh and justfile.

This commit add a bash command to `clean` recipe and try to improve the
clean process through some big temporary files. In some local tests,
those jumped from 0 to 51G in /tmp/folder.

Also, it add `--preserve-data-dir` to `tests/run.sh` in
`.github/workflows/functional.yml`, so it can log the failures when a
test fail in CI.

Fix getfloresta#848.
@csgui
Copy link
Copy Markdown
Collaborator

csgui commented Feb 19, 2026

Cool! It seems reasonable that scripts should be POSIX compatible unless there is a specific need that force them to use some other shell.

@csgui
Copy link
Copy Markdown
Collaborator

csgui commented Feb 19, 2026

ACK 31b8cdb

@qlrd
Copy link
Copy Markdown
Contributor Author

qlrd commented Feb 20, 2026

Cool! It seems reasonable that scripts should be POSIX compatible unless there is a specific need that force them to use some other shell.

yeah, CI will be unless we define in a job sh: bash. But it's a nice idea of yours to be "sh compatible"

Copy link
Copy Markdown
Collaborator

@moisesPompilio moisesPompilio left a comment

Choose a reason for hiding this comment

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

I don't think these modifications are safe: contrib/clean_data.sh is intended to clean project tmp files (./tmp), but your change removes items from the system /tmp, which can interfere with other applications.

- name: Run functional tests tasks
run: |
tests/run.sh
run: tests/run.sh --preserve-data-dir
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why use the --preserve-data-dir flag?

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.

because if not set, they will delete logs and the logs job in CI will show an error

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That doesn't make sense, because run.sh deletes the log before running the tests

Comment thread tests/run.sh
if [ "$PRESERVE_DATA" = false ]; then
echo "Cleaning up test directories before running tests..."
rm -rf "$FLORESTA_TEMP_DIR/logs"
sh contrib/clean_data.sh
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

humm, I think this won't work if FLORESTA_TEMP_DIR is set.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It wont, FLORESTA_TEMP_DIR is being ignored in clean_data.sh. If one needs to set FLORESTA_TEMP_DIR to another place, the script will fail to find it.

@jaoleal
Copy link
Copy Markdown
Member

jaoleal commented Feb 21, 2026

Approach NACK

The presented changes introduce unnecessary logic to filter out big files, it would be easier to just delete everything thats test-generated if the objective is to have clean environments to re run tests.

In #306, when clean_data.sh was introduced, we weren't creating any test directory for the integration tests, when they were introduced the cleaning logic was already thought, test data are placed under /tmp which is ephemeral.

@qlrd
Copy link
Copy Markdown
Contributor Author

qlrd commented Feb 21, 2026

Approach NACK

The presented changes introduce unnecessary logic to filter out big files, it would be easier to just delete everything thats test-generated if the objective is to have clean environments to re run tests.

In #306, when clean_data.sh was introduced, we weren't creating any test directory for the integration tests, when they were introduced the cleaning logic was already thought, test data are placed under /tmp which is ephemeral.

unnecessary is to need manually remove every time i do a test in local machine with 51 GB in my /tmp folder when it reach a quota.

@qlrd
Copy link
Copy Markdown
Contributor Author

qlrd commented Feb 21, 2026

I don't think these modifications are safe: contrib/clean_data.sh is intended to clean project tmp files (./tmp), but your change removes items from the system /tmp, which can interfere with other applications.

Are you run locally or just push to CI? I bet the second because if you do the first (and if you did the first IDK why it was ignored), every time you do it, you could see AFAIK 51GB on whatever could be FLORESTA_TEMP_DIR, either in ./tmp' or /tmp´. So if your concern is to affect the system, it's already affects who run tests locally.

@moisesPompilio
Copy link
Copy Markdown
Collaborator

NACK

I think the proposed changes don't add improvement to the project; changing clean_data.sh to another functionality doesn't make sense. Also, I ran the integration tests several times and the space they occupy is less than 400 MB, so I don't see the point in cleaning it; besides, it stays in /tmp by default which is cleaned automatically by the system.

@csgui
Copy link
Copy Markdown
Collaborator

csgui commented Mar 16, 2026

PR closed since it is not actually need. Reopen discussion if need.

@csgui csgui closed this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants