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

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
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
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
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
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 54092 488
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
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement