Repository navigation
Keep deviceName/osVersion filter on sessionPerTest rotated sessions - #9
Merged
Merged
Conversation
mobilewright's connect() only forwards platform/deviceId/deviceType, so sessions started on rotation picked any matching-platform device. allocate() now records the slot's criteria in the run log and startFreshSession() reads them back.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
With
sessionPerTest: true, only the first test on each pool slot respected the project'sdeviceName/osVersionfilter. Every later test started a fresh session inconnect(). mobilewright 0.0.68'sconnectDevice()callsconnect()with onlyplatform,deviceId,deviceTypeandtimeout, sostartFreshSession()picked from every real device on the platform. A customer reported getting a Pixel on Android 7.1 despiteosVersion: '>=12'and adeviceNameregex.Fix
allocate()(coordinator) appends aslotrecord to the run log with the slot'sdeviceType,osVersionanddeviceNamePattern. It only does this whensessionPerTestis on.startFreshSession()(worker) looks that record up by the pooldeviceIdand uses it for the device pick. Values passed directly toconnect()still take precedence.Tests
test/integration/pool-lifecycle.test.ts: a rotated session keeps the filter. It fails without the fix.