[go: nahoru, domu]

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

Minor fixes in edge forwarder and zip utils for dev/host mode #6065

Merged
merged 2 commits into from
May 16, 2022

Conversation

whummer
Copy link
Member
@whummer whummer commented May 15, 2022

Minor fixes for issues that surfaced during testing in local dev/host mode:

  • When using the HTTPS forwarding server on port 443 (using EDGE_FORWARD_URL), we need to forward the requests using the raw path of the HTTP request (otherwise request parsing fails downstream, e.g., for URL-encoded ARNs passed in request paths). Issue can be replicated, e.g., with this command (after starting LS in Pro host mode): awslocal kafka --endpoint-url https://localhost.localstack.cloud get-bootstrap-brokers --cluster-arn arn:aws:kafka:us-east-1:000000000000:cluster/test. The existing get_raw_path(..) http utility comes in handy here. Added a small test for it as well.

  • Prefer using the native unzip command (if available) over the built-in Python zipfile utils. Some versions of Node.js / Serverless are generating zip files with invalid/incorrect CRC codes (e.g., here) - the files extract fine with unzip (potentially generating some warnings), but the unzipping fails with Python utils (empty files being created on disk). In future, we could think about introducing a strict mode for the unzip utils to enforce CRC codes, if needed.

The changes above should not impact the current logic inside the Docker container (only relevant for host mode).

Additionally, the PR contains a few minor cleanups:

  • Remove the obsolete/unused params argument for the start_proxy(..) utility - resolves a TODO: not being used comment
  • Remove a few instances of unnecessary time.sleep(..) calls in the tests

@whummer whummer temporarily deployed to localstack-ext-tests May 15, 2022 15:16 Inactive
@@ -32,7 +32,6 @@ def test_start_and_stop(self, monkeypatch):
backend_port,
update_listener=None,
quiet=True,
params={"protocol_version": "HTTP/1.0"},
Copy link
Member Author
@whummer whummer May 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Value currently not being used/processed downstream, so this change does not change the logic itself.

@github-actions
Copy link
github-actions bot commented May 15, 2022

LocalStack integration with Pro

       3 files  ±0         3 suites  ±0   1h 4m 3s ⏱️ - 4m 16s
1 010 tests +1     971 ✔️ +1  39 💤 ±0  0 ±0 
1 306 runs  +1  1 240 ✔️ +1  66 💤 ±0  0 ±0 

Results for commit b312c92. ± Comparison against base commit c55ce9e.

♻️ This comment has been updated with latest results.

@whummer whummer temporarily deployed to localstack-ext-tests May 15, 2022 16:11 Inactive
@whummer whummer temporarily deployed to localstack-ext-tests May 15, 2022 17:44 Inactive
@whummer whummer requested review from thrau and alexrashed May 15, 2022 18:30
Copy link
Member
@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Looks great and actually fixes the issue which would have been addressed with #6059. 🚀

Copy link
Member
@thrau thrau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@whummer whummer merged commit d7c4e7b into master May 16, 2022
@whummer whummer deleted the host-mode-fixes branch May 16, 2022 09:15
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2022
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.

None yet

3 participants