reactphp-socks icon indicating copy to clipboard operation
reactphp-socks copied to clipboard

Update tests to close any server sockets

Open dinooo13 opened this issue 2 years ago • 2 comments

Close open connections in tests to prevent them from looping in the async update.

Based on https://github.com/reactphp/socket/pull/283 and https://github.com/clue/reactphp-docker/pull/79

Ref: https://github.com/clue/reactphp-socks/pull/110

dinooo13 avatar Oct 21 '22 22:10 dinooo13

I closed the sockets but it seems thats not enough to fix it with the async changes. Do you have any ideas?

dinooo13 avatar Oct 21 '22 22:10 dinooo13

I closed the sockets but it seems thats not enough to fix it with the async changes. Do you have any ideas?

New ways to inspect the loop are currently being discussed in https://github.com/orgs/reactphp/discussions/472#discussioncomment-3895536, perhaps you want to join the discussion?

As a quick hack, you can add the following dummy test case that would return instantly if the loop has nothing to do, but keep running forever if there are any leftovers from previous tests. You can then move this around in your test suite and check which test cases cause leftovers to help isolate the problem.

    public function testA()
    {
        Loop::run();
    }

clue avatar Oct 22 '22 11:10 clue