molotov icon indicating copy to clipboard operation
molotov copied to clipboard

On Python 3.10 support

Open athos-ribeiro opened this issue 4 years ago • 3 comments

Python 3.10, released on Oct. 4, 2021, removed support to the loop keyword argument on some asyncio functions [1.2].

The test suite now fails to run, with most failures showing

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

However, the loop kw argument was only deprecated in Python 3.7. Hence, to support Python 3.10, it seems that checking for python minor versions may be required if Python 3.6 support is to be maintained.

Below is the test failures report [3]

[1] https://docs.python.org/3.10/whatsnew/changelog.html#id42 [2] https://bugs.python.org/issue42392

[3]

=================================== FAILURES ===================================
_____________________________ TestFmwk.test_runner _____________________________

self = <molotov.tests.test_fmwk.TestFmwk testMethod=test_runner>

    @dedicatedloop
    def test_runner(self):
        with coserver():
>           return self._runner(console=False)

molotov/tests/test_fmwk.py:171: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_fmwk.py:162: in _runner
    results = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a763850>
futures = (<Task pending name='Task-2' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/lo...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
____________________________ TestRunner.test_sizing ____________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_sizing>

    @dedicatedloop
    def test_sizing(self):
        _RES2["fail"] = 0
        _RES2["succ"] = 0
    
        with catch_sleep():
    
            @scenario()
            async def sizer(session):
                if random.randint(0, 20) == 1:
                    _RES2["fail"] += 1
                    raise AssertionError()
                else:
                    _RES2["succ"] += 1
    
>           stdout, stderr, rc = self._test_molotov(
                "--sizing",
                "--console-update",
                "0",
                "--sizing-tolerance",
                "5",
                "-s",
                "sizer",
                "molotov.tests.test_run",
            )

molotov/tests/test_run.py:403: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a792dd0>
futures = (<Task pending name='Task-6' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-7' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_________________________ TestFmwk.test_runner_console _________________________

self = <molotov.tests.test_fmwk.TestFmwk testMethod=test_runner_console>

    @dedicatedloop
    def test_runner_console(self):
        with coserver():
>           return self._runner(console=True)

molotov/tests/test_fmwk.py:176: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_fmwk.py:162: in _runner
    results = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a63e440>
futures = (<Task pending name='Task-9' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/lo...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_____________________ TestSharedConsole.test_simple_usage ______________________

self = <molotov.tests.test_sharedconsole.TestSharedConsole testMethod=test_simple_usage>

    @dedicatedloop
    def test_simple_usage(self):
        test_loop = asyncio.get_event_loop()
        stream = io.StringIO()
        console = SharedConsole(interval=0.0, stream=stream)
    
        async def add_lines():
            console.print("one")
            console.print("two")
            console.print("3")
            try:
                1 + "e"
            except Exception as e:
                console.print_error(e)
                console.print_error(e, sys.exc_info()[2])
            await asyncio.sleep(0.2)
            await console.stop()
    
        with catch_output() as (stdout, stderr):
            adder = asyncio.ensure_future(add_lines())
            displayer = asyncio.ensure_future(console.display())
>           test_loop.run_until_complete(asyncio.gather(adder, displayer))

molotov/tests/test_sharedconsole.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.10/asyncio/base_events.py:641: in run_until_complete
    return future.result()
molotov/sharedconsole.py:54: in display
    await cancellable_sleep(self._interval)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

delay = 0.0, result = None

    async def sleep(delay, result=None, *, loop=None):
>       coro = asyncio.sleep(delay, result=result, loop=loop)
E       TypeError: sleep() got an unexpected keyword argument 'loop'

molotov/util.py:197: TypeError
__________________ TestRunner.test_slow_server_force_shutdown __________________

self = <molotov.tests.test_run.TestRunner testMethod=test_slow_server_force_shutdown>

    @dedicatedloop_noclose
    def test_slow_server_force_shutdown(self):
        @scenario(weight=10)
        async def _one(session):
            async with session.get("http://localhost:8888/slow") as resp:
                assert resp.status == 200
                _RES.append(1)
    
        args = self._get_args()
        args.duration = 0.1
        args.verbose = 2
        args.max_runs = 1
        args.force_shutdown = True
        start = time.time()
        with coserver():
>           run(args)

molotov/tests/test_run.py:700: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a7ef2e0>
futures = (<Task pending name='Task-17' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/l...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
________________________ TestRunner.test_use_extension _________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_use_extension>

    @dedicatedloop
    def test_use_extension(self):
        ext = os.path.join(_HERE, "example5.py")
    
        @scenario(weight=10)
        async def simpletest(session):
            async with session.get("http://localhost:8888") as resp:
                assert resp.status == 200
    
        with coserver():
>           stdout, stderr, rc = self._test_molotov(
                "-cx",
                "--max-runs",
                "1",
                "--use-extension=" + ext,
                "-s",
                "simpletest",
                "molotov.tests.test_run",
            )

molotov/tests/test_run.py:597: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2912d990>
futures = (<Task pending name='Task-20' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-21' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
________________________ TestFmwk.test_setup_exception _________________________

self = <molotov.tests.test_fmwk.TestFmwk testMethod=test_setup_exception>

    @dedicatedloop
    def test_setup_exception(self):
        @setup()
        async def _worker_setup(num, args):
            raise Exception("bleh")
    
        @scenario(weight=100)
        async def test_two(session):
            os.kill(os.getpid(), signal.SIGTERM)
    
        args = self.get_args()
>       results = Runner(args)()

molotov/tests/test_fmwk.py:360: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce29a6bf10>
futures = (<Task pending name='Task-27' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/l...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_______________ TestRunner.test_sizing_multiprocess_interrupted ________________

self = <molotov.tests.test_run.TestRunner testMethod=test_sizing_multiprocess_interrupted>

    @unittest.skipIf(os.name == "nt", "win32")
    @dedicatedloop
    def test_sizing_multiprocess_interrupted(self):
    
        counters = SharedCounters("OK", "FAILED")
    
        @scenario()
        async def sizer(session):
            if random.randint(0, 10) == 1:
                counters["FAILED"] += 1
                raise AssertionError()
            else:
                counters["OK"] += 1
    
        async def _stop():
            await asyncio.sleep(2.0)
            os.kill(os.getpid(), signal.SIGINT)
    
        asyncio.ensure_future(_stop())
>       stdout, stderr, rc = self._test_molotov(
            "--sizing",
            "-p",
            "3",
            "--sizing-tolerance",
            "90",
            "--console-update",
            "0",
            "-s",
            "sizer",
            "molotov.tests.test_run",
        )

molotov/tests/test_run.py:573: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:117: in _launch_processes
    self.loop.run_until_complete(self.gather(*tasks))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce29a70d60>
futures = (<Task pending name='Task-32' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>, <Task pendi...>>, <Task pending name='Task-34' coro=<Runner._launch_processes.<locals>.run() running at /src/molotov/runner.py:101>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
------------------------------ Captured log call -------------------------------
ERROR    asyncio:base_events.py:1729 Task was destroyed but it is pending!
task: <Task pending name='Task-31' coro=<TestRunner.test_sizing_multiprocess_interrupted.<locals>._stop() running at /src/molotov/tests/test_run.py:568>>
_____________________ TestRunner.test_sizing_multiprocess ______________________

self = <molotov.tests.test_run.TestRunner testMethod=test_sizing_multiprocess>

    @unittest.skipIf(os.name == "nt", "win32")
    @dedicatedloop
    def test_sizing_multiprocess(self):
        counters = SharedCounters("OK", "FAILED")
    
        with catch_sleep():
    
            @scenario()
            async def sizer(session):
                if random.randint(0, 10) == 1:
                    counters["FAILED"] += 1
                    raise AssertionError()
                else:
                    counters["OK"] += 1
    
            with set_args(
                "molotov",
                "--sizing",
                "-p",
                "2",
                "--sizing-tolerance",
                "5",
                "--console-update",
                "0",
                "-s",
                "sizer",
                "molotov.tests.test_run",
            ) as (stdout, stderr):
                try:
>                   main()

molotov/tests/test_run.py:448: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:117: in _launch_processes
    self.loop.run_until_complete(self.gather(*tasks))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce291a7e20>
futures = (<Task pending name='Task-35' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>, <Task pendi...>>, <Task pending name='Task-37' coro=<Runner._launch_processes.<locals>.run() running at /src/molotov/runner.py:101>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_____________________________ TestRunner.test_main _____________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_main>

    @dedicatedloop
    def test_main(self):
        with set_args("molotov", "-cq", "-d", "1", "molotov/tests/example.py"):
>           main()

molotov/tests/test_run.py:133: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:202: in _process
    workers = self.gather(*self._runner())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a771de0>
futures = (<Task pending name='Task-40' coro=<Worker.run() running at /src/molotov/worker.py:44>>,)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_________________________ TestFmwk.test_setup_not_dict _________________________

self = <molotov.tests.test_fmwk.TestFmwk testMethod=test_setup_not_dict>

    @dedicatedloop
    def test_setup_not_dict(self):
        @setup()
        async def _worker_setup(num, args):
            return 1
    
        @scenario(weight=100)
        async def test_two(session):
            os.kill(os.getpid(), signal.SIGTERM)
    
        args = self.get_args()
>       results = Runner(args)()

molotov/tests/test_fmwk.py:403: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce291de470>
futures = (<Task pending name='Task-49' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/l...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_________________________ TestRunner.test_timed_sizing _________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_timed_sizing>

    @dedicatedloop
    def test_timed_sizing(self):
        _RES2["fail"] = 0
        _RES2["succ"] = 0
        _RES2["messed"] = False
    
        with catch_sleep():
    
            @scenario()
            async def sizer(session):
                if get_context(session).worker_id == 200 and not _RES2["messed"]:
                    # worker 2 will mess with the timer
                    # since we're faking all timers, the current
                    # time in the test is always around 0
                    # so to have now() - get_timer() > 60
                    # we need to set a negative value here
                    # to trick it
                    set_timer(-61)
                    _RES2["messed"] = True
                    _RES2["fail"] = _RES2["succ"] = 0
    
                if get_context(session).worker_id > 100:
                    # starting to introduce errors passed the 100th
                    if random.randint(0, 10) == 1:
                        _RES2["fail"] += 1
                        raise AssertionError()
                    else:
                        _RES2["succ"] += 1
    
                # forces a switch
                await asyncio.sleep(0)
    
>           stdout, stderr, rc = self._test_molotov(
                "--sizing",
                "--sizing-tolerance",
                "5",
                "--console-update",
                "0",
                "-cs",
                "sizer",
                "molotov.tests.test_run",
            )

molotov/tests/test_run.py:540: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a788d00>
futures = (<Task pending name='Task-52' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-53' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_______________________ TestFmwk.test_teardown_exception _______________________

self = <molotov.tests.test_fmwk.TestFmwk testMethod=test_teardown_exception>

    @dedicatedloop
    def test_teardown_exception(self):
        @teardown()
        def _teardown(args):
            raise Exception("bleh")
    
        @scenario(weight=100)
        async def test_two(session):
            os.kill(os.getpid(), signal.SIGTERM)
    
        args = self.get_args()
>       results = Runner(args)()

molotov/tests/test_fmwk.py:389: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce29a734c0>
futures = (<Task pending name='Task-55' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/l...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
____________________________ TestRunner.test_delay _____________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_delay>

    @dedicatedloop
    def test_delay(self):
        with catch_sleep() as delay:
    
            @scenario(weight=10, delay=0.1)
            async def here_three(session):
                _RES.append(3)
    
>           stdout, stderr, rc = self._test_molotov(
                "--delay",
                ".6",
                "--console-update",
                "0",
                "-cx",
                "--max-runs",
                "2",
                "-s",
                "here_three",
                "molotov.tests.test_run",
            )

molotov/tests/test_run.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce29a6c4f0>
futures = (<Task pending name='Task-58' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-59' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
________________________ TestQuickStart.test_codeworks _________________________

self = <molotov.tests.test_quickstart.TestQuickStart testMethod=test_codeworks>

    @dedicatedloop
    def test_codeworks(self):
        quickstart._input = self._input
    
        with set_args("molostart"):
            quickstart.main()
    
        result = os.listdir(self.location)
        result.sort()
        self.assertEqual(result, ["Makefile", "loadtest.py", "molotov.json"])
    
        os.chdir(self.location)
        with set_args("molotov", "-cxv", "--max-runs", "1"):
            try:
>               run.main()

molotov/tests/test_quickstart.py:71: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a7900a0>
futures = (<Task pending name='Task-61' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-62' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
___________________________ TestRunner.test_redirect ___________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_redirect>

    @dedicatedloop_noclose
    def test_redirect(self):
        @scenario(weight=10)
        async def _one(session):
            # redirected
            async with session.get("http://localhost:8888/redirect") as resp:
                redirect = resp.history
                assert redirect[0].status == 302
                assert resp.status == 200
    
            # not redirected
            async with session.get(
                "http://localhost:8888/redirect", allow_redirects=False
            ) as resp:
                redirect = resp.history
                assert len(redirect) == 0
                assert resp.status == 302
                content = await resp.text()
                assert content == ""
    
            _RES.append(1)
    
        args = self._get_args()
        args.verbose = 2
        args.max_runs = 2
        with coserver():
>           run(args)

molotov/tests/test_run.py:79: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce1b759ed0>
futures = (<Task pending name='Task-65' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/l...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_____________________ TestRunner.test_statsd_multiprocess ______________________

self = <molotov.tests.test_run.TestRunner testMethod=test_statsd_multiprocess>

    @unittest.skipIf(os.name == "nt", "win32")
    @dedicatedloop_noclose
    def test_statsd_multiprocess(self):
        test_loop = asyncio.get_event_loop()
    
        @scenario()
        async def staty(session):
            get_context(session).statsd.increment("yopla")
    
        server = UDPServer("127.0.0.1", 9999, loop=test_loop)
        _stop = asyncio.Future()
    
        async def stop():
            await _stop
            await server.stop()
    
        server_task = asyncio.ensure_future(server.run())
        stop_task = asyncio.ensure_future(stop())
        args = self._get_args()
        args.verbose = 2
        args.processes = 2
        args.max_runs = 5
        args.duration = 1000
        args.statsd = True
        args.statsd_address = "udp://127.0.0.1:9999"
        args.single_mode = "staty"
        args.scenario = "molotov.tests.test_run"
    
        stream = io.StringIO()
    
>       run(args, stream=stream)

molotov/tests/test_run.py:489: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:117: in _launch_processes
    self.loop.run_until_complete(self.gather(*tasks))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a820af0>
futures = (<Task pending name='Task-73' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35> created at /u...esses.<locals>.run() running at /src/molotov/runner.py:101> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_______________________ TestFmwk.test_shutdown_exception _______________________

self = <molotov.tests.test_fmwk.TestFmwk testMethod=test_shutdown_exception>

    @dedicatedloop
    def test_shutdown_exception(self):
        @teardown()
        def _worker_teardown(num):
            raise Exception("bleh")
    
        @global_teardown()
        def _teardown():
            raise Exception("bleh")
    
        @scenario(weight=100)
        async def test_two(session):
            os.kill(os.getpid(), signal.SIGTERM)
    
        args = self.get_args()
>       results = Runner(args)()

molotov/tests/test_fmwk.py:328: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce29103130>
futures = (<Task pending name='Task-77' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/l...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_____________________ TestRunner.test_slow_server_graceful _____________________

self = <molotov.tests.test_run.TestRunner testMethod=test_slow_server_graceful>

    @dedicatedloop_noclose
    def test_slow_server_graceful(self):
        @scenario(weight=10)
        async def _one(session):
            async with session.get("http://localhost:8888/slow") as resp:
                assert resp.status == 200
                _RES.append(1)
    
        args = self._get_args()
        args.duration = 0.1
        args.verbose = 2
        args.max_runs = 1
        # graceful shutdown on the other hand will wait
        # for the worker completion
        args.graceful_shutdown = True
    
        start = time.time()
        with coserver():
>           run(args)

molotov/tests/test_run.py:725: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce29a6a500>
futures = (<Task pending name='Task-81' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/l...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
____________________________ TestRunner.test_runner ____________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_runner>

    @dedicatedloop_noclose
    def test_runner(self):
        test_loop = asyncio.get_event_loop()
    
        @global_setup()
        def something_sync(args):
            grab = request("http://localhost:8888")
            self.assertEqual(grab["status"], 200)
            grab_json = json_request("http://localhost:8888/molotov.json")
            self.assertTrue("molotov" in grab_json["content"])
    
        @scenario(weight=10)
        async def here_one(session):
            async with session.get("http://localhost:8888") as resp:
                await resp.text()
            _RES.append(1)
    
        @scenario(weight=90)
        async def here_two(session):
            if get_context(session).statsd is not None:
                get_context(session).statsd.increment("yopla")
            _RES.append(2)
    
        args = self._get_args()
        server = UDPServer("127.0.0.1", 9999, loop=test_loop)
        _stop = asyncio.Future()
    
        async def stop():
            await _stop
            await server.stop()
    
        server_task = asyncio.ensure_future(server.run())
        stop_task = asyncio.ensure_future(stop())
        args.max_runs = 3
        args.duration = 9999
    
        with coserver():
>           run(args)

molotov/tests/test_run.py:120: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce29aa6830>
futures = (<Task pending name='Task-93' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/l...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_________________________ TestRunner.test_local_import _________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_local_import>

    @dedicatedloop
    def test_local_import(self):
        test = os.path.join(_HERE, "example9.py")
    
        with coserver():
>           stdout, stderr, rc = self._test_molotov("--max-runs", "1", test)

molotov/tests/test_run.py:849: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce1b75fd90>
futures = (<Task pending name='Task-97' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-98' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_____________________________ TestRunner.test_name _____________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_name>

    @dedicatedloop
    def test_name(self):
        @scenario(weight=10)
        async def here_three(session):
            _RES.append(3)
    
        @scenario(weight=30, name="me")
        async def here_four(session):
            _RES.append(4)
    
>       stdout, stderr, rc = self._test_molotov(
            "-cx", "--max-runs", "2", "-s", "me", "molotov.tests.test_run"
        )

molotov/tests/test_run.py:196: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a7ec310>
futures = (<Task pending name='Task-101' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-102' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
___________________________ TestRunner.test_bug_121 ____________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_bug_121>

    @dedicatedloop
    def test_bug_121(self):
    
        PASSED = [0]
    
        with catch_sleep():
    
            @scenario()
            async def scenario_one(session):
    
                cookies = {
                    "csrftoken": "sometoken",
                    "dtk": "1234",
                    "djdt": "hide",
                    "sessionid": "5678",
                }
                boundary = "----WebKitFormBoundaryFTE"
                headers = {
                    "X-CSRFToken": "sometoken",
                    "Content-Type": "multipart/form-data; boundary={}".format(boundary),
                }
                data = json.dumps({"1": "xxx"})
    
                with aiohttp.MultipartWriter(
                    "form-data", boundary=boundary
                ) as mpwriter:
                    mpwriter.append(
                        data,
                        {
                            "Content-Disposition": 'form-data; name="json"; filename="blob"',
                            "Content-Type": "application/json",
                        },
                    )
                    async with session.post(
                        "http://localhost:8888",
                        data=mpwriter,
                        headers=headers,
                        cookies=cookies,
                    ) as resp:
                        res = await resp.text()
                        assert data in res
                        PASSED[0] += 1
    
            args = self._get_args()
            args.verbose = 2
            args.max_runs = 1
            with coserver():
>               res = run(args)

molotov/tests/test_run.py:839: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce291f5c00>
futures = (<Task pending name='Task-105' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
__________________ TestRunner.test_use_extension_module_name ___________________

self = <molotov.tests.test_run.TestRunner testMethod=test_use_extension_module_name>

    @dedicatedloop
    def test_use_extension_module_name(self):
        ext = "molotov.tests.example5"
    
        @scenario(weight=10)
        async def simpletest(session):
            async with session.get("http://localhost:8888") as resp:
                assert resp.status == 200
    
        with coserver():
>           stdout, stderr, rc = self._test_molotov(
                "-cx",
                "--max-runs",
                "1",
                "--use-extension=" + ext,
                "-s",
                "simpletest",
                "molotov.tests.test_run",
            )

molotov/tests/test_run.py:640: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a651900>
futures = (<Task pending name='Task-108' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-109' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
____________________________ TestRunner.test_quiet _____________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_quiet>

    @dedicatedloop
    def test_quiet(self):
        @scenario(weight=10)
        async def here_three(session):
            _RES.append(3)
    
>       stdout, stderr, rc = self._test_molotov(
            "-cx", "--max-runs", "1", "-q", "-s", "here_three", "molotov.tests.test_run"
        )

molotov/tests/test_run.py:679: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:202: in _process
    workers = self.gather(*self._runner())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce1b71bb80>
futures = (<Task pending name='Task-114' coro=<Worker.run() running at /src/molotov/worker.py:44>>,)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
________________________ TestRunner.test_fail_mode_fail ________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_fail_mode_fail>

    @dedicatedloop
    def test_fail_mode_fail(self):
        @scenario(weight=10)
        async def here_three(session):
            assert False
    
>       stdout, stderr, rc = self._test_molotov(
            "-cx",
            "--max-runs",
            "2",
            "--fail",
            "1",
            "-s",
            "here_three",
            "molotov.tests.test_run",
        )

molotov/tests/test_run.py:241: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce1b75a3e0>
futures = (<Task pending name='Task-118' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-119' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
____________________________ TestRunner.test_uvloop ____________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_uvloop>

    @skip_pypy
    @dedicatedloop
    def test_uvloop(self):
        try:
            import uvloop  # noqa
        except ImportError:
            return
    
        @scenario(weight=10)
        async def here_three(session):
            _RES.append(3)
    
>       stdout, stderr, rc = self._test_molotov(
            "-cx",
            "--max-runs",
            "2",
            "-s",
            "here_three",
            "--uvloop",
            "molotov.tests.test_run",
        )

molotov/tests/test_run.py:321: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce29a6f220>
futures = (<Task pending name='Task-121' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-122' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_________________________ TestRunner.test_single_mode __________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_single_mode>

    @dedicatedloop
    def test_single_mode(self):
        @scenario(weight=10)
        async def here_three(session):
            _RES.append(3)
    
>       stdout, stderr, rc = self._test_molotov(
            "-cx", "--max-runs", "2", "-s", "here_three", "molotov.tests.test_run"
        )

molotov/tests/test_run.py:209: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce29091b70>
futures = (<Task pending name='Task-124' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-125' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
_____________________ TestSharedConsole.test_multiprocess ______________________

self = <molotov.tests.test_sharedconsole.TestSharedConsole testMethod=test_multiprocess>

    @unittest.skipIf(os.name == "nt", "win32")
    @dedicatedloop
    def test_multiprocess(self):
        test_loop = asyncio.get_event_loop()
    
        # now let's try with several processes
        pool = multiprocessing.Pool(3)
        try:
            inputs = [1] * 3
            pool.map(run_worker, inputs)
        finally:
            pool.close()
    
        async def stop():
            await asyncio.sleep(1)
            await _CONSOLE.stop()
    
        with catch_output() as (stdout, stderr):
            stop = asyncio.ensure_future(stop())
            display = asyncio.ensure_future(_CONSOLE.display())
>           test_loop.run_until_complete(asyncio.gather(stop, display))

molotov/tests/test_sharedconsole.py:94: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.10/asyncio/base_events.py:641: in run_until_complete
    return future.result()
molotov/sharedconsole.py:54: in display
    await cancellable_sleep(self._interval)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

delay = 0.0, result = None

    async def sleep(delay, result=None, *, loop=None):
>       coro = asyncio.sleep(delay, result=result, loop=loop)
E       TypeError: sleep() got an unexpected keyword argument 'loop'

molotov/util.py:197: TypeError
_____________________________ TestSlave.test_main ______________________________

self = <molotov.tests.test_slave.TestSlave testMethod=test_main>

    @dedicatedloop
    @mock.patch("molotov.slave.check_call", new=check_call)
    def test_main(self):
        with set_args("moloslave", _REPO, "test", "--directory", self.dir) as out:
>           main()

molotov/tests/test_slave.py:40: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/slave.py:141: in main
    run_test(**config["molotov"]["tests"][args.run])
molotov/slave.py:62: in run_test
    return run(args)
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a820550>
futures = (<Task pending name='Task-132' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-133' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
________________________ TestRunner.test_fail_mode_pass ________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_fail_mode_pass>

    @dedicatedloop
    def test_fail_mode_pass(self):
        @scenario(weight=10)
        async def here_three(session):
            _RES.append(3)
    
>       stdout, stderr, rc = self._test_molotov(
            "-cx",
            "--max-runs",
            "2",
            "--fail",
            "1",
            "-s",
            "here_three",
            "molotov.tests.test_run",
        )

molotov/tests/test_run.py:221: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce2a279840>
futures = (<Task pending name='Task-135' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-136' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
____________________________ TestFmwk.test_shutdown ____________________________

self = <molotov.tests.test_fmwk.TestFmwk testMethod=test_shutdown>

    @dedicatedloop
    def test_shutdown(self):
        res = []
    
        @teardown()
        def _worker_teardown(num):
            res.append("BYE WORKER")
    
        @global_teardown()
        def _teardown():
            res.append("BYE")
    
        @scenario(weight=100)
        async def test_two(session):
            os.kill(os.getpid(), signal.SIGTERM)
    
        args = self.get_args()
>       results = Runner(args)()

molotov/tests/test_fmwk.py:307: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce1b71a320>
futures = (<Task pending name='Task-138' coro=<Runner._display_results() running at /src/molotov/runner.py:236> created at /usr/...sole.display() running at /src/molotov/sharedconsole.py:35> created at /usr/local/lib/python3.10/asyncio/tasks.py:638>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
__________________________ TestRunner.test_single_run __________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_single_run>

    @dedicatedloop
    def test_single_run(self):
        _RES = defaultdict(int)
    
        with catch_sleep():
    
            @scenario()
            async def one(session):
                _RES["one"] += 1
    
            @scenario()
            async def two(session):
                _RES["two"] += 1
    
            @scenario()
            async def three(session):
                _RES["three"] += 1
    
>           stdout, stderr, rc = self._test_molotov(
                "--single-run", "molotov.tests.test_run",
            )

molotov/tests/test_run.py:749: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce1b755a20>
futures = (<Task pending name='Task-141' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-142' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError
____________________________ TestRunner.test_rampup ____________________________

self = <molotov.tests.test_run.TestRunner testMethod=test_rampup>

    @dedicatedloop
    def test_rampup(self):
        with catch_sleep() as delay:
    
            @scenario(weight=10)
            async def here_three(session):
                _RES.append(3)
    
>           stdout, stderr, rc = self._test_molotov(
                "--ramp-up",
                "10",
                "--workers",
                "5",
                "--console-update",
                "0",
                "-cx",
                "--max-runs",
                "2",
                "-s",
                "here_three",
                "molotov.tests.test_run",
            )

molotov/tests/test_run.py:365: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
molotov/tests/test_run.py:141: in _test_molotov
    main()
molotov/run.py:220: in main
    run(args)
molotov/run.py:301: in run
    res = Runner(args)()
molotov/runner.py:73: in __call__
    return self._launch_processes()
molotov/runner.py:119: in _launch_processes
    self._process()
molotov/runner.py:199: in _process
    display = self.gather(update, display)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <molotov.runner.Runner object at 0x7fce291031f0>
futures = (<Task pending name='Task-145' coro=<Runner._display_results() running at /src/molotov/runner.py:236>>, <Task pending name='Task-146' coro=<SharedConsole.display() running at /src/molotov/sharedconsole.py:35>>)

    def gather(self, *futures):
>       return asyncio.gather(*futures, loop=self.loop, return_exceptions=True)
E       TypeError: gather() got an unexpected keyword argument 'loop'

molotov/runner.py:57: TypeError

=========================== short test summary info ============================
FAILED molotov/tests/test_fmwk.py::TestFmwk::test_runner - TypeError: gather(...
FAILED molotov/tests/test_run.py::TestRunner::test_sizing - TypeError: gather...
FAILED molotov/tests/test_fmwk.py::TestFmwk::test_runner_console - TypeError:...
FAILED molotov/tests/test_sharedconsole.py::TestSharedConsole::test_simple_usage
FAILED molotov/tests/test_run.py::TestRunner::test_slow_server_force_shutdown
FAILED molotov/tests/test_run.py::TestRunner::test_use_extension - TypeError:...
FAILED molotov/tests/test_fmwk.py::TestFmwk::test_setup_exception - TypeError...
FAILED molotov/tests/test_run.py::TestRunner::test_sizing_multiprocess_interrupted
FAILED molotov/tests/test_run.py::TestRunner::test_sizing_multiprocess - Type...
FAILED molotov/tests/test_run.py::TestRunner::test_main - TypeError: gather()...
FAILED molotov/tests/test_fmwk.py::TestFmwk::test_setup_not_dict - TypeError:...
FAILED molotov/tests/test_run.py::TestRunner::test_timed_sizing - TypeError: ...
FAILED molotov/tests/test_fmwk.py::TestFmwk::test_teardown_exception - TypeEr...
FAILED molotov/tests/test_run.py::TestRunner::test_delay - TypeError: gather(...
FAILED molotov/tests/test_quickstart.py::TestQuickStart::test_codeworks - Typ...
FAILED molotov/tests/test_run.py::TestRunner::test_redirect - TypeError: gath...
FAILED molotov/tests/test_run.py::TestRunner::test_statsd_multiprocess - Type...
FAILED molotov/tests/test_fmwk.py::TestFmwk::test_shutdown_exception - TypeEr...
FAILED molotov/tests/test_run.py::TestRunner::test_slow_server_graceful - Typ...
FAILED molotov/tests/test_run.py::TestRunner::test_runner - TypeError: gather...
FAILED molotov/tests/test_run.py::TestRunner::test_local_import - TypeError: ...
FAILED molotov/tests/test_run.py::TestRunner::test_name - TypeError: gather()...
FAILED molotov/tests/test_run.py::TestRunner::test_bug_121 - TypeError: gathe...
FAILED molotov/tests/test_run.py::TestRunner::test_use_extension_module_name
FAILED molotov/tests/test_run.py::TestRunner::test_quiet - TypeError: gather(...
FAILED molotov/tests/test_run.py::TestRunner::test_fail_mode_fail - TypeError...
FAILED molotov/tests/test_run.py::TestRunner::test_uvloop - TypeError: gather...
FAILED molotov/tests/test_run.py::TestRunner::test_single_mode - TypeError: g...
FAILED molotov/tests/test_sharedconsole.py::TestSharedConsole::test_multiprocess
FAILED molotov/tests/test_slave.py::TestSlave::test_main - TypeError: gather(...
FAILED molotov/tests/test_run.py::TestRunner::test_fail_mode_pass - TypeError...
FAILED molotov/tests/test_fmwk.py::TestFmwk::test_shutdown - TypeError: gathe...
FAILED molotov/tests/test_run.py::TestRunner::test_single_run - TypeError: ga...
FAILED molotov/tests/test_run.py::TestRunner::test_rampup - TypeError: gather...
=========== 34 failed, 51 passed, 1 skipped, 144 warnings in 16.36s ============

athos-ribeiro avatar Oct 19 '21 13:10 athos-ribeiro

I'd vouch to drop support for Python 3.6 and simply embrace the new syntax.

n1ngu avatar Jan 25 '22 12:01 n1ngu

Yeah +1 on dropping 3.6 support

tarekziade avatar Jan 25 '22 15:01 tarekziade

Is "the new syntax" just removing the loop parameter?

julienw avatar Mar 02 '22 12:03 julienw

Hello, what is the status for molotov python 3.10 support? We are coming up on 1 year of python 3.10 being released, I see there is an open PR.

jdubs11 avatar Sep 13 '22 17:09 jdubs11

@jdubs11 I have not had the time to look at it I am busy on other projects, I'll try this week (or if some folks are interested in helping for the maintenance)

tarekziade avatar Sep 13 '22 18:09 tarekziade