AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

VCR Fix for debug_code_challenge_a

Open gravelBridge opened this issue 1 year ago • 6 comments

Background

When using @pytest.vcr.mark, and then using docker, the test hangs as vcr intercepts the docker call, and is stuck inside an infinite loop. This is due to the vcr library checking if the instance is part of the vcr class, and if it isn't it's stuck inside a while loop. The test is from @merwanehamadi

Changes

I modified the vcr library to skip the while loop if the instance is docker. This prevents the hang, and tests using @pytest.vcr.mark work correctly now. As a result, I modified requirements.txt to use my slightly modified version of vcr with the fix, find pr here: https://github.com/kevin1024/vcrpy/pull/692

Documentation

The test comes from @merwanehamadi, and I modified the vcrpy library to allow @pytest.mark.vcr to work without hanging the test.

Test Plan

I have tested the test with my version of vcrpy, and everything works perfectly.

PR Quality Checklist

  • [x] My pull request is atomic and focuses on a single change.
  • [x] I have thoroughly tested my changes with multiple different prompts.
  • [x] I have considered potential risks and mitigations for my changes.
  • [x] I have documented my changes clearly and comprehensively.
  • [x] I have not snuck in any "extra" small tweaks changes

I have not added tests as all I have done is fix the vcr hanging issue, which will not affect the functionality of vcr if the instance is not docker.

gravelBridge avatar May 06 '23 21:05 gravelBridge

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 6, 2023 9:11pm

vercel[bot] avatar May 06 '23 21:05 vercel[bot]

This PR exceeds the recommended size of 200 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size

github-actions[bot] avatar May 06 '23 21:05 github-actions[bot]

Fantastic! I'll try to test this later today. Most likely for tomorrow.

dschonholtz avatar May 12 '23 16:05 dschonholtz

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar May 13 '23 19:05 github-actions[bot]

A bajilion years later. This appears to work. The agent removes all errors by re-writing the code.py with a single print statement, but the test still passes for some reason. I'm gonna try to figure out why.

dschonholtz avatar May 16 '23 14:05 dschonholtz

You must manually remove the existing vcrpy lib though, so we will need to figure out why that is and how to mitigate that going forward

dschonholtz avatar May 16 '23 14:05 dschonholtz

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar May 25 '23 18:05 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar May 30 '23 23:05 github-actions[bot]

Already picked up in another PR according to Wayne. Closing :)

Pwuts avatar Jun 14 '23 15:06 Pwuts