Skip to content

chore: clear cache for conda default test - #258

Merged
sgaist merged 2 commits into
mainfrom
chore/clear-cache-for-conda
Jul 23, 2026
Merged

chore: clear cache for conda default test#258
sgaist merged 2 commits into
mainfrom
chore/clear-cache-for-conda

Conversation

@sgaist

@sgaist sgaist commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

The conda default test build sometimes fail for unexpected reasons unrelated to the logic of the buildpacks and thus is retried.

Usually, the second try is successful however it uses the cache generated from the initial build and while it shows a working buildpack, the logs generated from this second build will not contain the expected output.

Thus in this case, clear the caches when building. It will do nothing for the initial build, and ensures that the second one starts from fresh.

Use Cases

Reduce the flackyness of the tests as the error generated in this case comes only from not having the log containing the expected content.

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@sgaist
sgaist requested review from a team as code owners July 21, 2026 10:07
@sgaist sgaist added the semver:patch A change requiring a patch version bump label Jul 21, 2026
@sgaist
sgaist enabled auto-merge (squash) July 21, 2026 10:10
@sgaist

sgaist commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

One thing to think about, there is a similar issue with the when the app is rebuilt and a different conda version is required test in the reuse layer tests. The check fails because the a rebuild happens and thus the second time, the newly generated cache is used.
On possible alternative would be to return a list of the logs when a retry happens. This would allow to check more precisely what went on.

When retried, it will use the cache created in the first
instance and it will fail log parsing checks. Clearing
the cache will ensure no layer reuse.
@sgaist
sgaist force-pushed the chore/clear-cache-for-conda branch from 32549bb to 320d27c Compare July 22, 2026 18:34
The RetryBuild struct is used with conda tests which are
prone to errors unrelated to the buildpack itself. Restarting
the build usually fixes that but will take advantage of
the cache having been created during the first build and
thus loses the information searched.
Thus Keeping all the logs will allow the tests that verify that
conda has been installed once. It is not possible for all
the tests to just clear the cache as some of them are
verifying that the existing cache is indeed not used.
@sgaist

sgaist commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

I implemented returning all the logs as a single string currently as there is another test that also checks that a different version of Miniconda has been freshly installed over an existing cache and thus cannot use clear cache when building.

@sgaist
sgaist merged commit cfb76ff into main Jul 23, 2026
10 checks passed
@sgaist
sgaist deleted the chore/clear-cache-for-conda branch July 23, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:patch A change requiring a patch version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants