mspanc

mspanc

Membrane Core Team

Integration testing fake HTTP server

Hello,

I am writing an app that is accessing a HTTP server via HTTPoison and shoud be very resillent when it comes to error handling. I would like to make some integration tests and spawn some fake HTTP server from Elixir in order to handle responses. It should be able to e.g. break TCP connection after some data sent (in order to simulate broken connection).

Does anyone know any project that can ease such task? I would prefer to avoid reimplementing HTTP server.

Most Liked

sribe

sribe

Not that I have ever find. It was on my to-do list at a prior job, but never found time. My boss even had a nick-name for the idea “WWW Server”, short for “world’s worst web server” :wink:

I think the fundamental problem is that there is no web server anywhere that was designed with this kind of idea in mind: “when you respond to this specific upcoming request, drop the connection halfway through sending the headers”, or “never finish sending the body”, etc…

mertonium

mertonium

I’ve had success using bypass as a “fake” server for tests. Although I don’t if it is possible to have it simulate a broken connection.

Qqwy

Qqwy

TypeCheck Core Team

This is a very interesting idea, and something that Elixir would be very well-suited for, I think :D.

Where Next?

Popular in Questions Top

vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 42576 114
New

We're in Beta

About us Mission Statement