annoviko / robotframework-httpctrl

HttpCtrl is a library for Robot Framework that provides API of HTTP(S) client and server
https://annoviko.github.io/robotframework-httpctrl/
BSD 3-Clause "New" or "Revised" License
13 stars 2 forks source link

[HttpCtrl.Server] Several requests at once #3

Closed annoviko closed 5 years ago

annoviko commented 5 years ago

Introduction HttpCtrl.Server is not able to handle situation where several requests came at once. Server stores only the last received request. Therefore if several requests are sent by sever then only the last will be processed (previous will be overwritten).

How to Reproduce

Server Receives Two Messages at Once
    Initialize Client   127.0.0.1   8000
    Start Server        127.0.0.1   8000

    Send HTTP Request Async   POST   /post   Message to Post
    Send HTTP Request Async   PUT    /put    Message to Put

    # Check for the POST message
    Wait For Request
    ${method}=   Get Request Method
    ${url}=      Get Request Url
    ${body}=     Get Request Body

    Should Be Equal   ${method}   POST
    Should Be Equal   ${url}      /post
    Should Be Equal   ${body}     Message to Post

    Wait For Request
    ${method}=   Get Request Method
    ${url}=      Get Request Url
    ${body}=     Get Request Body

    Should Be Equal   ${method}   PUT
    Should Be Equal   ${url}      /put
    Should Be Equal   ${body}     Message to Put

    Stop Server

Description HttpCtrl.Server should be able to process requests that come at the same moment.

annoviko commented 5 years ago

Already works, test issue.