Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor test_scheduler to test relevant properties instead of exact order #1976

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yuk-m-labs
Copy link

@yuk-m-labs yuk-m-labs commented Oct 10, 2022

ARTIQ Pull Request

Description of Changes

Currently, test_pending_priority is checking the exact order of events.
But it actually need test only:

  • An early due_date experiment (RID 2) is scheduled to run before a late due_date experiment (RID 1), regardless of their priorities

Other test cases are also refactored to use similar methods.

Related Issue

Closes #1888

Type of Changes

Type
🐛 Bug fix

Steps (Choose relevant, delete irrelevant before submitting)

All Pull Requests

  • Use correct spelling and grammar.
  • Close/update issues.
  • Check the copyright situation of your changes and sign off your patches (git commit --signoff, see copyright).

Code Changes

Git Logistics

  • Split your contribution into logically separate changes (git rebase --interactive). Merge/squash/fixup commits that just fix or amend previous commits. Remove unintended changes & cleanup. See tutorial.
  • Write short & meaningful commit messages. Review each commit for messages (git show). Format:
    topic: description. < 50 characters total.
    
    Longer description. < 70 characters per line
    

Licensing

See copyright & licensing for more info.
ARTIQ files that do not contain a license header are copyrighted by M-Labs Limited and are licensed under LGPLv3+.

RID 2 has earlier due_date than RID 1 so it is chosen for running.
RID 2 should complete all basic steps.

Signed-off-by: yuk <[email protected]>
Do not look into mod directly in individual tests

Signed-off-by: yuk <[email protected]>
@yuk-m-labs yuk-m-labs changed the title Change test_scheduler test_pending_priority to test relevant properties instead of exact order Refactor test_scheduler to test relevant properties instead of exact order Oct 13, 2022
def _notify(self, mod):
process_mod(self.experiments, mod)
for rid, events in self.status_events.items():
if (mod["action"] == "setitem" and
Copy link
Member

Choose a reason for hiding this comment

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

Why would you both use process_mod and then look at the mod values?

@dnadlinger
Copy link
Collaborator

Merged a narrow fix in #2484, but this still looks useful. The merge conflicts can just be resolved by just replacing the test implementation from #2484 with the one from this PR whole-sale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scheduler test failing
3 participants