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

Implement a mechanism in edx-platform to duplicate GET requests and send them both to v1 and v2 #4

Closed
regisb opened this issue Jul 25, 2024 · 2 comments
Assignees

Comments

@regisb
Copy link
Contributor

regisb commented Jul 25, 2024

Past experience with the Ruby unit tests indicates that test coverage is not sufficient to give us great confidence about the reliability of the v2 implementation. Thus, we propose to add an extra layer of confidence by testing the v2 API GET endpoints in production. This will be done by sending GET requests both to the v1 and the v2 backends:

response1 = client.get(“http://forum/api/” + endpoint, params=params)
response2 = client.get(“http://forumv2/api/” + endpoint, params=params) # "forumv2" is actually "localhost:8000"
if response2 != response1:
    logging.error(f“Forum v2 diff for endpoint {endpoint} with params={params}. Expected: {response1}. Got: {response2}.”)
return response1

Our goal will be to remove all such errors. Because GET requests are idempotent, and most of the complexity of the v1 API comes from GET endpoints, this approach will considerably improve our confidence in the new v2 implementation.

Running duplicate queries will undoubtedly cause slowdowns. If these slowdowns are unacceptable, then we will duplicate queries for a randomized subsample of all requests.

@Faraz32123
Copy link
Contributor

Closing this issue as it's related PR in edx-platform is tested and merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants