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

Fix test failure when running Rosetta tests #322

Closed
pendo324 opened this issue Mar 28, 2023 · 1 comment · Fixed by #327
Closed

Fix test failure when running Rosetta tests #322

pendo324 opened this issue Mar 28, 2023 · 1 comment · Fixed by #327
Labels
bug Something isn't working

Comments

@pendo324
Copy link
Member

Describe the bug
The Rosetta tests added #282 are failing (example).

It may just be because they are running after QEMU and Virtualization.framework tests in sequence, it may just be some flakiness only observed when Rosetta is enabled, or it may be something else entirely.

Steps to reproduce
make test-e2e on a macOS 13+ AMD64 system, with Rosetta enabled, while having a Finch config (~/.finch/finch.yaml) which contains the following:

...
vmType: vz
rosetta: true
...

Expected behavior
Tests should pass.

Screenshots or logs
https://github.com/runfinch/finch/actions/runs/4545132549/jobs/8012048120?pr=282#logs:

 Virtualization framework Virtualization framework and Rosetta Run a container image with --rm flag, container should be removed when it exits
/Users/ec2-user/go/pkg/mod/github.com/runfinch/common-tests@v0.6.2/tests/run.go:70
  No containers to be removed
  No images to be removed
  No volumes to be removed
  bridge
  host
  none
  No networks to be removed
  public.ecr.aws/docker/library/alpine:latest: resolving      |--------------------------------------| 
  elapsed: 0.1 s                               total:   0.0 B (0.0 B/s)                                         
  public.ecr.aws/docker/library/alpine:latest:                                      resolved       |++++++++++++++++++++++++++++++++++++++| 
  index-sha256:ff6bdca1701f3a8a67e328815ff2346b0e4067d32ec36b7992c1fdc001dc8517:    done           |++++++++++++++++++++++++++++++++++++++| 
  manifest-sha256:c41ab5c992deb4fe7e5da09f67a8804a46bd0592bfdf0b1847dde0e0889d2bff: done           |++++++++++++++++++++++++++++++++++++++| 
  config-sha256:d74e625d91152966d38fe8a62c60daadb96d4b94c1a366de01fab5f334806239:   done           |++++++++++++++++++++++++++++++++++++++| 
  elapsed: 0.2 s                                                                    total:   0.0 B (0.0 B/s)                                         
  time="2023-03-28T16:33:41Z" level=fatal msg="name \"ctr-test\" is already used by ID \"3c08eb578b671caefc48cc73eab0793870439cf43852a9689d24715a7aa60db7\""
  time="2023-03-28T16:33:41Z" level=fatal msg="exit status 1"
  [FAILED] in [It] - /Users/ec2-user/go/pkg/mod/github.com/runfinch/common-tests@v0.6.2/command/command.go:122 @ 03/28/23 16:33:41.945
  No containers to be removed

Additional context
Add any other context about the problem here.

@pendo324 pendo324 added the bug Something isn't working label Mar 28, 2023
@pendo324
Copy link
Member Author

The issue is caused by running the tests in sequence. The old container named ctr-test is never cleaned up when it's created while running the Virtualization framework test suite, and then when the ctr-test name is used again in the Virtualization.framework + Rosetta suite, because of persistent volume, the name is still in use.

This can be seen by searching for 3c08eb578b671caefc48cc73eab0793870439cf43852a9689d24715a7aa60db7 in the logs linked in issue OP.

pendo324 added a commit to runfinch/common-tests that referenced this issue Apr 6, 2023
Issue #, if available: runfinch/finch#322,
specifically regarding this comment
runfinch/finch#327 (comment)

*Description of changes:*
- instantiate a new `NewServeMux` every time the test is run
- use the `SpecContext` context instead of the default background
context

*Testing done:*
- tested by using go.mod `replace ()` and running tests locally



- [x] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

Signed-off-by: Justin Alvarez <alvajus@amazon.com>
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 a pull request may close this issue.

1 participant