From 4880d0a011b40df8caccbc05a16e8ef442728210 Mon Sep 17 00:00:00 2001 From: Robert Steiner Date: Sat, 2 Nov 2024 09:42:04 +0100 Subject: [PATCH] fix(framework:skip) Fix Socket closed error in e2e tests (#4410) Signed-off-by: Robert Steiner --- e2e/e2e-bare/e2e_bare/server_app.py | 2 +- e2e/e2e-fastai/e2e_fastai/server_app.py | 2 +- e2e/e2e-jax/e2e_jax/server_app.py | 2 +- e2e/e2e-opacus/e2e_opacus/server_app.py | 2 +- e2e/e2e-pandas/e2e_pandas/server_app.py | 2 +- e2e/e2e-pytorch-lightning/e2e_pytorch_lightning/server_app.py | 2 +- e2e/e2e-pytorch/e2e_pytorch/server_app.py | 4 ++-- e2e/e2e-pytorch/simulation.py | 2 +- e2e/e2e-scikit-learn/e2e_scikit_learn/client_app.py | 2 +- e2e/e2e-scikit-learn/e2e_scikit_learn/server_app.py | 2 +- e2e/e2e-tensorflow/e2e_tensorflow/server_app.py | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/e2e/e2e-bare/e2e_bare/server_app.py b/e2e/e2e-bare/e2e_bare/server_app.py index cb4f65eed0da..0f7a8968a2f8 100644 --- a/e2e/e2e-bare/e2e_bare/server_app.py +++ b/e2e/e2e-bare/e2e_bare/server_app.py @@ -61,7 +61,7 @@ def main(driver, context): ) hist = fl.server.start_server( - server_address="0.0.0.0:8080", + server_address="127.0.0.1:8080", config=fl.server.ServerConfig(num_rounds=3), strategy=strategy, ) diff --git a/e2e/e2e-fastai/e2e_fastai/server_app.py b/e2e/e2e-fastai/e2e_fastai/server_app.py index cb4f65eed0da..0f7a8968a2f8 100644 --- a/e2e/e2e-fastai/e2e_fastai/server_app.py +++ b/e2e/e2e-fastai/e2e_fastai/server_app.py @@ -61,7 +61,7 @@ def main(driver, context): ) hist = fl.server.start_server( - server_address="0.0.0.0:8080", + server_address="127.0.0.1:8080", config=fl.server.ServerConfig(num_rounds=3), strategy=strategy, ) diff --git a/e2e/e2e-jax/e2e_jax/server_app.py b/e2e/e2e-jax/e2e_jax/server_app.py index cb4f65eed0da..0f7a8968a2f8 100644 --- a/e2e/e2e-jax/e2e_jax/server_app.py +++ b/e2e/e2e-jax/e2e_jax/server_app.py @@ -61,7 +61,7 @@ def main(driver, context): ) hist = fl.server.start_server( - server_address="0.0.0.0:8080", + server_address="127.0.0.1:8080", config=fl.server.ServerConfig(num_rounds=3), strategy=strategy, ) diff --git a/e2e/e2e-opacus/e2e_opacus/server_app.py b/e2e/e2e-opacus/e2e_opacus/server_app.py index cb4f65eed0da..0f7a8968a2f8 100644 --- a/e2e/e2e-opacus/e2e_opacus/server_app.py +++ b/e2e/e2e-opacus/e2e_opacus/server_app.py @@ -61,7 +61,7 @@ def main(driver, context): ) hist = fl.server.start_server( - server_address="0.0.0.0:8080", + server_address="127.0.0.1:8080", config=fl.server.ServerConfig(num_rounds=3), strategy=strategy, ) diff --git a/e2e/e2e-pandas/e2e_pandas/server_app.py b/e2e/e2e-pandas/e2e_pandas/server_app.py index 06f3eb68bb28..65098a6bad7c 100644 --- a/e2e/e2e-pandas/e2e_pandas/server_app.py +++ b/e2e/e2e-pandas/e2e_pandas/server_app.py @@ -49,7 +49,7 @@ def main(driver, context): if __name__ == "__main__": hist = fl.server.start_server( - server_address="0.0.0.0:8080", + server_address="127.0.0.1:8080", config=fl.server.ServerConfig(num_rounds=1), strategy=FedAnalytics(), ) diff --git a/e2e/e2e-pytorch-lightning/e2e_pytorch_lightning/server_app.py b/e2e/e2e-pytorch-lightning/e2e_pytorch_lightning/server_app.py index cb4f65eed0da..0f7a8968a2f8 100644 --- a/e2e/e2e-pytorch-lightning/e2e_pytorch_lightning/server_app.py +++ b/e2e/e2e-pytorch-lightning/e2e_pytorch_lightning/server_app.py @@ -61,7 +61,7 @@ def main(driver, context): ) hist = fl.server.start_server( - server_address="0.0.0.0:8080", + server_address="127.0.0.1:8080", config=fl.server.ServerConfig(num_rounds=3), strategy=strategy, ) diff --git a/e2e/e2e-pytorch/e2e_pytorch/server_app.py b/e2e/e2e-pytorch/e2e_pytorch/server_app.py index cb4f65eed0da..3b089fdc8803 100644 --- a/e2e/e2e-pytorch/e2e_pytorch/server_app.py +++ b/e2e/e2e-pytorch/e2e_pytorch/server_app.py @@ -61,7 +61,7 @@ def main(driver, context): ) hist = fl.server.start_server( - server_address="0.0.0.0:8080", + server_address="127.0.0.1:8080", config=fl.server.ServerConfig(num_rounds=3), strategy=strategy, ) @@ -72,7 +72,7 @@ def main(driver, context): ) if STATE_VAR in hist.metrics_distributed: - # The checks in record_state_metrics don't do anythinng if client's state has a single entry + # The checks in record_state_metrics don't do anything if client's state has a single entry state_metrics_last_round = hist.metrics_distributed[STATE_VAR][-1] assert ( len(state_metrics_last_round[1][0]) == 2 * state_metrics_last_round[0] diff --git a/e2e/e2e-pytorch/simulation.py b/e2e/e2e-pytorch/simulation.py index c465fbc4816e..032fbe738f28 100644 --- a/e2e/e2e-pytorch/simulation.py +++ b/e2e/e2e-pytorch/simulation.py @@ -44,7 +44,7 @@ def record_state_metrics(metrics: List[Tuple[int, Metrics]]) -> Metrics: or (hist.losses_distributed[0][1] / hist.losses_distributed[-1][1]) >= 0.98 ) -# The checks in record_state_metrics don't do anythinng if client's state has a single entry +# The checks in record_state_metrics don't do anything if client's state has a single entry state_metrics_last_round = hist.metrics_distributed[STATE_VAR][-1] assert ( len(state_metrics_last_round[1][0]) == 2 * state_metrics_last_round[0] diff --git a/e2e/e2e-scikit-learn/e2e_scikit_learn/client_app.py b/e2e/e2e-scikit-learn/e2e_scikit_learn/client_app.py index ae00c240c9ba..cd87aeb15fab 100644 --- a/e2e/e2e-scikit-learn/e2e_scikit_learn/client_app.py +++ b/e2e/e2e-scikit-learn/e2e_scikit_learn/client_app.py @@ -56,4 +56,4 @@ def client_fn(context: Context): if __name__ == "__main__": # Start Flower client - start_client(server_address="0.0.0.0:8080", client=FlowerClient().to_client()) + start_client(server_address="127.0.0.1:8080", client=FlowerClient().to_client()) diff --git a/e2e/e2e-scikit-learn/e2e_scikit_learn/server_app.py b/e2e/e2e-scikit-learn/e2e_scikit_learn/server_app.py index cb4f65eed0da..0f7a8968a2f8 100644 --- a/e2e/e2e-scikit-learn/e2e_scikit_learn/server_app.py +++ b/e2e/e2e-scikit-learn/e2e_scikit_learn/server_app.py @@ -61,7 +61,7 @@ def main(driver, context): ) hist = fl.server.start_server( - server_address="0.0.0.0:8080", + server_address="127.0.0.1:8080", config=fl.server.ServerConfig(num_rounds=3), strategy=strategy, ) diff --git a/e2e/e2e-tensorflow/e2e_tensorflow/server_app.py b/e2e/e2e-tensorflow/e2e_tensorflow/server_app.py index cb4f65eed0da..0f7a8968a2f8 100644 --- a/e2e/e2e-tensorflow/e2e_tensorflow/server_app.py +++ b/e2e/e2e-tensorflow/e2e_tensorflow/server_app.py @@ -61,7 +61,7 @@ def main(driver, context): ) hist = fl.server.start_server( - server_address="0.0.0.0:8080", + server_address="127.0.0.1:8080", config=fl.server.ServerConfig(num_rounds=3), strategy=strategy, )