Skip to content

Commit

Permalink
Update test_trainer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthsub committed Sep 11, 2021
1 parent d1804bc commit 93b389a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/trainer/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,7 @@ class CustomException(Exception):

class TestModel(BoringModel):
def training_step(self, batch, batch_idx):
logging.error(f"Dumping os environ: {os.environ}")
if batch_idx == 1 and self.trainer.is_global_zero:
# rank 0: raises an exception
# rank 1: continues training but will hang on the next barrier in the training loop
Expand All @@ -1829,7 +1830,6 @@ def training_step(self, batch, batch_idx):
)

# simulate random failure in training_step on rank 0
logging.warning(f"Dumping os environ: {os.environ}")
with pytest.raises(DeadlockDetectedException):
trainer.fit(model)

Expand Down

0 comments on commit 93b389a

Please sign in to comment.