Comments (13)
This is actually not intended, but we didn't run in any problems with our test cases so far. :/
I don't think it should be hard to make this work.
from bypass.
I've also had issues with concurrent requests, but couldn't figure out how to make a quick fix. Hope to find time next week to look into it more.
from bypass.
This looks like the same problem @MSch and I talked about a few months back. I believe it worked just fine in previous versions of bypass
.
from bypass.
@MSch What's your take on implementing this functionality? I personally can't come up with a compelling use case. Bypass is primarily used for testing the correctness of the client requests and the handling of responses. What exactly would a Bypass handler that can be invoked concurrently help test?
from bypass.
It would be useful when your application code is making concurrent requests.
On Wednesday, 1 June 2016, Alexei Sholik [email protected] wrote:
@MSch https://github.com/MSch What's your take on implementing this
functionality? I personally can't come up with a compelling use case.
Bypass is primarily used for testing the correctness of the client requests
and the handling of responses. What exactly would a Bypass handler that can
be invoked concurrently help test?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#12 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AATV2u1lcGpOSnayv-qinKCfMevSzqg1ks5qHcIOgaJpZM4H8IPP
.
Eric Meadows-Jönsson
from bypass.
Same issue here.
I've got a client that makes concurrent requests to get paginated resources and it makes Bypass crash.
from bypass.
@eidge could you please provide the details of the crash? Which exact error are you getting?
from bypass.
Yup, backtrace:
15:27:33.207 [error] GenServer #PID<0.446.0> terminating
** (FunctionClauseError) no function clause matching in anonymous fn/1 in Bypass.Instance.handle_cast/2
(bypass) lib/bypass/instance.ex:75: anonymous fn(#PID<0.462.0>) in Bypass.Instance.handle_cast/2
(elixir) lib/map.ex:513: Map.update!/3
(bypass) lib/bypass/instance.ex:75: Bypass.Instance.handle_cast/2
(stdlib) gen_server.erl:615: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:681: :gen_server.handle_msg/5
(stdlib) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
15:27:33.207 [error] #PID<0.463.0> running Bypass.Plug terminated
Server: localhost:35482 (http)
Request: GET /filter_gfs_1p00.pl?file=gfs.t00z.pgrb2.1p00.f003&lev_1000_mb=on&lev_100_mb=on&lev_150_mb=on&lev_200_mb=on&lev_250_mb=on&lev_300_mb=on&lev_350_mb=on&lev_400_mb=on&lev_4
50_mb=on&lev_500_mb=on&lev_550_mb=on&lev_600_mb=on&lev_650_mb=on&lev_700_mb=on&lev_750_mb=on&lev_800_mb=on&lev_850_mb=on&lev_900_mb=on&lev_925_mb=on&lev_950_mb=on&lev_975_mb=on&lev_
high_cloud_layer=on&lev_low_cloud_layer=on&lev_mean_sea_level=on&lev_middle_cloud_layer=on&lev_surface=on&var_CAPE=on&var_CIN=on&var_DPT=on&var_GUST=on&var_HGT=on&var_HPBL=on&var_PR
ES=on&var_PRMSL=on&var_RH=on&var_TCDC=on&var_TMP=on&var_UGRD=on&var_VGRD=on&lev_2_m_above_ground=on&leftlon=0&rightlon=360&toplat=90&bottomlat=-90&dir=%2Fgfs.2016063000
** (exit) exited in: GenServer.call(#PID<0.446.0>, :get_expect_fun, :infinity)
** (EXIT) no process
from bypass.
@eidge Thanks. I hope to find time to look into adding support for concurrent requests at some point.
from bypass.
Same here, works fine with one request but breaks on more (made with async TaskSupervisor). Here's the output:
15:56:37.154 [error] GenServer #PID<0.253.0> terminating ** (FunctionClauseError) no function clause matching in anonymous fn/1 in Bypass.Instance.handle_cast/2 (bypass) lib/bypass/instance.ex:75: anonymous fn(#PID<0.265.0>) in Bypass.Instance.handle_cast/2 (elixir) lib/map.ex:513: Map.update!/3 (bypass) lib/bypass/instance.ex:75: Bypass.Instance.handle_cast/2 (stdlib) gen_server.erl:601: :gen_server.try_dispatch/4 (stdlib) gen_server.erl:667: :gen_server.handle_msg/5 (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3 15:56:37.154 [error] #PID<0.265.0> running Bypass.Plug terminated Server: localhost:40707 (http) Request: GET /ok/endpoint ** (exit) exited in: GenServer.call(#PID<0.253.0>, {:put_expect_result, :ok_call}, :infinity) ** (EXIT) no process 15:56:37.154 [error] #PID<0.264.0> running Bypass.Plug terminated Server: localhost:40707 (http) Request: GET /another/ok/endpoint ** (exit) exited in: GenServer.call(#PID<0.253.0>, {:put_expect_result, :ok_call}, :infinity) ** (EXIT) no process
from bypass.
I currently have the same issue too, it seems to be totally random as at least 60% of the time it works, then I tend to get random failures with the same message as above
from bypass.
We independently found this issue, as well, and would love to see it patched. PR submitted.
from bypass.
Adding #36 which fixes this issue properly.
from bypass.
Related Issues (20)
- Pipe expectations
- Add 'headers' param in expect and expect_once function HOT 1
- Building error with erlang 22 HOT 3
- Update cowlib dependency HOT 3
- Cannot wait (with timeout) for expectations HOT 4
- How to use bypass with Finch? HOT 2
- How to test request timeout with bypass? HOT 2
- Any support for ranch 2.x? HOT 3
- Crash on shutdown in `dispatch_awaiting_callers` HOT 2
- bypass randomly fails with eaddrinuse error
- bypass does not support paths containing ":" HOT 2
- Error initializing bypass HOT 1
- Match on request body HOT 1
- dialyzer issue
- Elixir 1.15 incompatible? HOT 1
- Warning on Elixir 1.16 HOT 3
- Support for bandit instead plug_cowboy HOT 1
- Multiple expect_once HOT 4
- New release? HOT 5
- Move primary documentation out of the README HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bypass.