Code Monkey home page Code Monkey logo

Comments (13)

kurlenda avatar kurlenda commented on September 28, 2024

Furthermore, if any exception occurs inside Runnable.run method consecutive test fails also to start (despite of using workaround described by @marcingrzejszczak)

from moco.

dreamhead avatar dreamhead commented on September 28, 2024

@marcingrzejszczak Have you described your scenario correctly? Because your second piece of code create another server instance which is different the first server instance and will return nothing.

from moco.

marcingrzejszczak avatar marcingrzejszczak commented on September 28, 2024

Yes the scenario is correct. Imagine that you have two @test methods that each start a new http server in the same way - that's what I do here in the test : I create a server, start it, run some logic, stop it, create a new server, start it, run logic, stop it. The second server creation fails.

@Test
public void some_test1() {
 HttpServer server = httpServer(...)

running(...)
}

/**
An exception will be thrown in this test most presumably due to closing of the connection
**/
@Test
public void some_test2() {
 HttpServer server = httpServer(...) 

running(...)
}

You are reffering to the fact that I am not setting the response? You're right but It didn't matter since the connection never took place. - ok I fixed the test and you were right (my mistake) - there was an exception due to bad request. So I can't reproduce this issue in the Moco tests but we do have it in our testing code.

from moco.

dreamhead avatar dreamhead commented on September 28, 2024

Confirmed, it's definitely an issue. I'll try to fix it.

from moco.

marcingrzejszczak avatar marcingrzejszczak commented on September 28, 2024

So you did manage to reproduce it? Could you please show such a test scenario since we were unable to create one in your code base?

from moco.

dreamhead avatar dreamhead commented on September 28, 2024

Sorry, I did not reproduce it. I guess the issue is caused by Netty Asynchronous Model. Most of my test cases are all synchronised. When the test try to shutdown server, it just call shutdown method which does not mean the server has already completely shut down and some socket still work until it finish its own job.

I can figure out a solution. But I'm not sure it works very well because it not that easy to reproduce it.

from moco.

marcingrzejszczak avatar marcingrzejszczak commented on September 28, 2024

Is it possible for you to write down a solution here? We could then try to install a changed version of Moco oin our side and verify if the problem is fixed.

And you are talking about which error - issue related to starting of Moco server in test suites or when exception is thrown in the Runnable part?

from moco.

dreamhead avatar dreamhead commented on September 28, 2024

Try await() or sync() variants for bossGroup and workerGroup in MocoServer class.

This issue is related to starting Moco server, actually, related to stopping server.

from moco.

marcingrzejszczak avatar marcingrzejszczak commented on September 28, 2024

It turned out that we have already done some variants of await() or sync() and it didn't change anything :(

from moco.

dreamhead avatar dreamhead commented on September 28, 2024

Sorry for that late. Too busy on my personal work.

The difficulty for me is I can not reproduce it in my local environment. I remembered that one of my friends had this issue before. I've ask him to reproduce it. One other solution is to use your workaround in stop method. I'll add this workaround as temporary solution.

from moco.

marcingrzejszczak avatar marcingrzejszczak commented on September 28, 2024

Like I said I'm pretty sure that the workaround will not work properly since we've already tried to implement it.

from moco.

marcingrzejszczak avatar marcingrzejszczak commented on September 28, 2024

That's awesome! That change should work - will try to test it ASAP. When are you planning a release?

from moco.

dreamhead avatar dreamhead commented on September 28, 2024

0.9.1, Feb 1st.

from moco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.