Use Maze Runner dedicated idempotent commands #2322
Merged
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.
Goal
Moves the e2e test fixture to the idempotent commands pattern.
Design
The thrust of the change should be familiar from the bugsnag-android-performance fixture that already uses idempotent commands. The new
/idem-commandendpoint that only supports idempotent commands is used as the functionality will eventually be removed from the/commandendpoint.Changeset
New
PersistentDataclass created to factor code out of theMainActivityand avoid static analysis failures (we could do more here in time).Whilst implementing the change and, in particular, running the tests several times with additional logging I made some additional changes to reduce test flakes:
CONFIG_FILE_TIMEOUTincreased as sometimes the file was not found in time. Further resilience may be needed in this area in future.onCreatenow records whether the activity is being recreated and prevents a new command runner from being started if that's the case. Thanks to extra logging I found that a second thread was being created, causing the same command to be run more than once and tests to fail. The existingpollingflag was not sufficient as a new object must be instantiated causing it to be false (in hindsight I could have tried making it static).Testing
Covered by a full CI run.