Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Fix issue with parsing implied volumes #2290

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

tylerslaton
Copy link
Contributor

This fixes two things:

  • When we were evaluating the Dirs of a Container, we did not ensure a deterministic order. This would cause a flake in the calling tests where a behavior was wrong or right depending on the order of how the Dirs were evaluated. This is fixed by using typed.Sorted.
  • If an existing Volume had "" set as the size, we would error and ignore it. This is a problem as some new logic allows for Volumes to be parsed and have "" as a size. The fix for this is to create a 0 size quantity when "" is set as the size.

I validate that this is gone by running the following script several times.

#!/bin/zsh
for i in {1..20}; do
  go test -count 1 -timeout 7m -run ^TestVolumes$ github.com/acorn-io/runtime/pkg/appdefinition &
done
wait

Checklist

  • The title of this PR would make a good line in Acorn's Release Note's Changelog
  • The title of this PR ends with a link to the main issue being address in parentheses, like: This is a title (#1216). Here's an example
  • All relevant issues are referenced in the PR description. NOTE: don't use GitHub keywords that auto-close issues
  • Commits follow contributing guidance
  • Automated tests added to cover the changes. If tests couldn't be added, an explanation is provided in the Verification and Testing section
  • Changes to user-facing functionality, API, CLI, and upgrade impacts are clearly called out in PR description
  • PR has at least two approvals before merging (or a reasonable exception, like it's just a docs change)

This fixes two things:
- When we were evaluating the Dirs of a Container, we did not ensure
  a deterministic order. This would cause a flake in the calling tests
  where a behavior was wrong or right depending on the order of how the
  Dirs were evaluated. This is fixed by using typed.Sorted.
- If an existing Volume had "" set as the size, we would error and ignore
  it. This is a problem as some new logic allows for Volumes to be parsed
  and have "" as a size. The fix for this is to create a 0 size quantity
  when "" is set as the size.

Signed-off-by: tylerslaton <mtslaton1@gmail.com>
@tylerslaton tylerslaton merged commit 77f8432 into acorn-io:main Oct 25, 2023
@tylerslaton tylerslaton deleted the fix-app-def-flake branch October 25, 2023 19:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants