Skip to content

Commit

Permalink
Change the fake repo that simulates an import error while loading dag…
Browse files Browse the repository at this point in the history
…ster code (#7816)

Summary:
Something about importing a made up module seems to cause transient segfaults. Let's try a simpler failure that just raises a Dagster exception instead.

Test Plan: BK
  • Loading branch information
gibsondan committed May 10, 2022
1 parent 1f0d9fb commit ccb2fd1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
from made_up_module import made_up_function # pylint:disable=import-error,unused-import
from dagster import ScheduleDefinition

# Definition that will fire an error when it is imported
ScheduleDefinition(cron_schedule="* * * * * * * * * *", pipeline_name="foo")
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def test_load_with_error(capfd):
process.wait()

_, err = capfd.readouterr()
assert "No module named" in err
assert "Dagster recognizes standard cron expressions" in err
finally:
if process.poll() is None:
process.terminate()
Expand Down Expand Up @@ -469,7 +469,7 @@ def test_lazy_load_with_error():
DagsterGrpcClient(port=port).list_repositories()
)
assert isinstance(list_repositories_response, SerializableErrorInfo)
assert "No module named" in list_repositories_response.message
assert "Dagster recognizes standard cron expressions" in list_repositories_response.message
finally:
process.terminate()

Expand Down Expand Up @@ -502,7 +502,9 @@ def test_lazy_load_via_env_var():
DagsterGrpcClient(port=port).list_repositories()
)
assert isinstance(list_repositories_response, SerializableErrorInfo)
assert "No module named" in list_repositories_response.message
assert (
"Dagster recognizes standard cron expressions" in list_repositories_response.message
)
finally:
process.terminate()

Expand Down

0 comments on commit ccb2fd1

Please sign in to comment.