e363904af067de1beac98313c0a6f8362980d406,distributed/tests/test_scheduler.py,,test_service_hosts,#,1138

Before Change


    pytest.importorskip("bokeh")
    from distributed.bokeh.scheduler import BokehScheduler

    for port in [0, ("127.0.0.3", 0)]:
        for url, expected in [("tcp://0.0.0.0", ("::", "0.0.0.0")),
                              ("tcp://127.0.0.2", "127.0.0.2"),
                              ("tcp://127.0.0.2:38275", "127.0.0.2")]:
            services = {("bokeh", port): BokehScheduler}

            s = Scheduler(services=services)
            yield s.start(url)

            sock = first(s.services["bokeh"].server._http._sockets.values())
            if isinstance(port, tuple):    // host explicitly overridden
                assert sock.getsockname()[0] == port[0]
            elif isinstance(expected, tuple):
                assert sock.getsockname()[0] in expected
            else:
                assert sock.getsockname()[0] == expected
            yield s.close()


@gen_cluster(client=True, worker_kwargs={"profile_cycle_interval": 100})
def test_profile_metadata(c, s, a, b):
    start = time() - 1
    futures = c.map(slowinc, range(10), delay=0.05, workers=a.address)

After Change


        s = Scheduler(services=services)
        yield s.start(url)

        sock = first(s.services["bokeh"].server._http._sockets.values())
        assert sock.getsockname()[0] == "127.0.0.1"
        yield s.close()

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: dask/distributed
Commit Name: e363904af067de1beac98313c0a6f8362980d406
Time: 2019-04-09
Author: mrocklin@gmail.com
File Name: distributed/tests/test_scheduler.py
Class Name:
Method Name: test_service_hosts


Project Name: sahana/eden
Commit Name: 2e268c86eee6a1753d16afe23388c9f26dd0f7ca
Time: 2020-01-27
Author: fran@aidiq.com
File Name: modules/templates/default/monitor.py
Class Name: S3Monitor
Method Name: email_round_trip


Project Name: OpenMined/Grid
Commit Name: 0bce5765b02513a167e454f112a61bd70d47d6ff
Time: 2020-03-02
Author: ionesiojr@gmail.com
File Name: gateway/app/main/processes/controller.py
Class Name: FLController
Method Name: last_participation