Conversation
Modal changed their error message format from "No such environment" to "Environment 'pytest' not found". Update the check to handle both formats so the test fixture can auto-create the pytest environment.
There was a problem hiding this comment.
Pull request overview
This PR fixes Modal CI environment detection by updating the error message check in the test fixture. Modal has changed its error message format from "No such environment" to "Environment 'pytest' not found", and this change allows the test fixture to auto-create the pytest environment when it doesn't exist.
Changes:
- Updated error message detection in the
modal_deploymentfixture to handle both the old "No such environment" and new "not found" error message formats
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if result.returncode != 0: | ||
| # if it fails simply because the environment does not exist, we can fix that | ||
| if "No such environment" in result.stderr: | ||
| if "No such environment" in result.stderr or "not found" in result.stderr: |
There was a problem hiding this comment.
The substring "not found" is too generic and could match unintended error messages. For example, it would match errors like "modal: command not found", "file not found", or "module not found", which would incorrectly trigger environment creation instead of failing with the actual error.
Based on the PR description, the new error format is "Environment 'pytest' not found". Consider using a more specific check like "Environment" in result.stderr and "not found" in result.stderr, or use a case-insensitive pattern match for "environment.*not found".
| if "No such environment" in result.stderr or "not found" in result.stderr: | |
| if "No such environment" in result.stderr or ( | |
| "Environment" in result.stderr and "not found" in result.stderr | |
| ): |
The pytest environment uses the latest PyTorch (2.9.x), so relax the check to just verify we're on PyTorch 2.x instead of a specific version.
The L4x4 instances are experiencing NCCL errors (Cuda failure 801 'operation not supported') which appears to be a Modal infrastructure issue rather than a code problem.
Remove assertion for specific Torch version in system info test.
Summary
Test plan