Repository navigation
Scope setlist mutation wire shapes by CorOS profile #59
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
Draft
tony-xmelon
wants to merge
12
commits into
stokes-audio:main
Choose a base branch
from
tony-xmelon:codex/setlist-file-shapes
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
265ce60
Match Cortex setlist mutation shapes
tony-xmelon bf4cd0a
Scope setlist wire shapes to CorOS 4.1
tony-xmelon 5b47240
Merge remote-tracking branch 'upstream/main' into codex/setlist-file-…
tony-xmelon 08895b5
Merge remote-tracking branch 'upstream/main' into codex/setlist-file-…
tony-xmelon a16cba6
Fix profile-aware session expectation
tony-xmelon f7c89ff
Merge remote-tracking branch 'upstream/main' into codex/setlist-file-…
tony-xmelon 61b0e2a
Merge remote-tracking branch 'upstream/main' into codex/setlist-file-…
tony-xmelon a706f3f
Record setlist profile measurements
tony-xmelon 5b3f7a3
Verify disposable setlist profile operations
tony-xmelon 9ed2d4e
Allow complete setlist listing windows in hardware test
tony-xmelon 95a7cea
Merge remote-tracking branch 'upstream/main' into codex/setlist-file-…
tony-xmelon 544506d
Skip 4.1 setlist hardware test on unmeasured firmware
tony-xmelon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| """Disposable-folder hardware checks for the profile-owned setlist shapes.""" | ||
|
|
||
| import time | ||
| import uuid | ||
|
|
||
| import pytest | ||
|
|
||
| FOLDER_LIST_TIMEOUT = 20.0 | ||
|
|
||
|
|
||
| def _folder_named(qc, key, *, seconds=FOLDER_LIST_TIMEOUT): | ||
| return next((folder for folder in qc.list_folders(seconds=seconds) | ||
| if folder.key.rstrip("/") == key.rstrip("/")), None) | ||
|
|
||
|
|
||
| def _wait_for_folder(qc, key, *, present, timeout=90.0): | ||
| deadline = time.monotonic() + timeout | ||
| while True: | ||
| # A complete device listing can take about fifteen seconds; do not | ||
| # cut it off at ten and mistake a slow generation for a missing folder. | ||
| folder = _folder_named(qc, key) | ||
| if (folder is not None) is present: | ||
| return folder | ||
| remaining = deadline - time.monotonic() | ||
| if remaining <= 0: | ||
| state = "appear" if present else "disappear" | ||
| raise AssertionError( | ||
| f"disposable setlist {key!r} did not {state} within {timeout}s") | ||
| time.sleep(min(2.0, remaining)) | ||
|
|
||
|
|
||
| @pytest.mark.verifies("create_setlist", "delete_setlist") | ||
| def test_create_and_delete_an_empty_disposable_setlist(qc, profile): | ||
| """Exercise both exact profile builders without touching user content. | ||
|
|
||
| The only folder this test may delete is a unique, preflight-absent name | ||
| that it just created and read back as empty. It never saves, recalls, moves, | ||
| or deletes a preset. If DELETE has an uncertain result, it reads the folder | ||
| state and does not replay the persistent write. | ||
| """ | ||
| operations = ("create_setlist", "delete_setlist") | ||
| if ("4.1.0" not in profile.MEASURED_ON | ||
| or any(name not in profile.VERIFIED for name in operations)): | ||
| pytest.skip(f"setlist writes are not VERIFIED on {profile.__name__}") | ||
|
|
||
| from pyquadcortex.protocol.client import USER_SETLIST_ROOT | ||
|
|
||
| name = f"QC disposable {uuid.uuid4().hex[:12]}" | ||
| key = f"{USER_SETLIST_ROOT}/{name}" | ||
| assert _folder_named(qc, key) is None, ( | ||
| f"random disposable name already exists; refusing to touch {key!r}") | ||
|
|
||
| create_attempted = False | ||
| delete_attempted = False | ||
| deleted = False | ||
| try: | ||
| # Set before invoking CREATE because a transport timeout can happen | ||
| # after the device has accepted the persistent write. | ||
| create_attempted = True | ||
| assert qc.create_setlist(name) == key | ||
| folder = _wait_for_folder(qc, key, present=True) | ||
| assert folder.name == name | ||
| assert folder.occupied == 0, ( | ||
| f"new disposable folder unexpectedly contains presets: {folder!r}; " | ||
| "refusing to delete its contents") | ||
|
|
||
| # Do not retry this write if it errors or times out. The test makes a | ||
| # fresh listing check below and reports the exact folder if it remains. | ||
| delete_attempted = True | ||
| qc.delete_setlist(name) | ||
| _wait_for_folder(qc, key, present=False) | ||
| deleted = True | ||
| finally: | ||
| if create_attempted and not delete_attempted: | ||
| # CREATE may have committed before an error. Cleanup is allowed only | ||
| # after a fresh listing confirms this exact unique folder is empty. | ||
| folder = _folder_named(qc, key) | ||
| if folder is not None: | ||
| if folder.occupied != 0: | ||
| pytest.fail( | ||
| f"created disposable folder {key!r} now contains " | ||
| f"{folder.occupied} presets; left untouched for manual review") | ||
| qc.delete_setlist(name) | ||
| _wait_for_folder(qc, key, present=False) | ||
| deleted = True | ||
| if delete_attempted and not deleted: | ||
| # An uncertain DELETE is never replayed: tell the operator exactly | ||
| # which empty test folder may need manual cleanup. | ||
| folder = _folder_named(qc, key) | ||
| if folder is not None: | ||
| pytest.fail( | ||
| f"DELETE result was not confirmed; disposable folder " | ||
| f"{key!r} still appears in the fresh listing and was not " | ||
| "deleted a second time") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.