Skip to content

Warning user if constraint function doesn't return a value#70

Merged
gomezzz merged 2 commits intomainfrom
Termination-function-is-executed-twice-if-the-constraint-function-has-no-return-value
Dec 19, 2022
Merged

Warning user if constraint function doesn't return a value#70
gomezzz merged 2 commits intomainfrom
Termination-function-is-executed-twice-if-the-constraint-function-has-no-return-value

Conversation

@gomezzz
Copy link
Collaborator

@gomezzz gomezzz commented Dec 12, 2022

Description

Added error in log like this

image

@GabrieleMeoni I could not find a way to raise an exception inside the async functions. Instead I display an error like above, good enough for now I think?

The original problem of the termination function running twice, I think, was already solved before?

Resolved Issues

How Has This Been Tested?

Specific test

Related Pull Requests

N/A

@gomezzz gomezzz added bug Something isn't working enhancement New feature or request user-facing Anything that users can interact with labels Dec 12, 2022
Copy link
Collaborator

@GabrieleMeoni GabrieleMeoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get any warning. I used the notebook attached to test it. What am I doing wrong?
notebook.zip

@gomezzz
Copy link
Collaborator Author

gomezzz commented Dec 19, 2022

I don't get any warning. I used the notebook attached to test it. What am I doing wrong? notebook.zip

You activity is too short. The constraint is never checked because it runs less than a second. If I increase the sleep in the activity to two seconds, it works for me. Can you check?

@GabrieleMeoni
Copy link
Collaborator

Yes, tested and works as expected for an activity lasting 2 seconds. Should we add an issue to notify the user about this problem? (You set a constraint function but the activity is too short and will never get tested.)? @gomezzz

@gomezzz
Copy link
Collaborator Author

gomezzz commented Dec 19, 2022

Yes, tested and works as expected for an activity lasting 2 seconds. Should we add an issue to notify the user about this problem? (You set a constraint function but the activity is too short and will never get tested.)? @gomezzz

@GabrieleMeoni Hm, depends, maybe we should be checking the constraint once before we start the activity? If so, then yes

@gomezzz gomezzz merged commit 2e2e3e0 into main Dec 19, 2022
@gomezzz gomezzz deleted the Termination-function-is-executed-twice-if-the-constraint-function-has-no-return-value branch December 19, 2022 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request user-facing Anything that users can interact with

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Termination function is executed twice if the constraint function has no return value

2 participants