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
[💡 Feature]: shared-store atomic operations #10010
Comments
Hey @pedrorfernandes, thanks for filing the issue. This seems indeed like useful idea. We would appreciate any help on this so please help us out! Have a look at our contributing guidelines and reach out if you have any questions. Cheers! |
Hey looks intresting and I would like to try this out if I am assigned this issue. |
Awesome @Ajneesh21 , let me know if you have any question contributing to the project. Note, we also have office hours to connect to contributors. |
@pedrorfernandes I wonder what would you suggest to provide an easier workflow going through multiple values. According to your proposal the const url = await getValueFromPool('hostnames') // one of ['url01.com', 'url02.com', 'url03.com'] then after the test: await releaseValueFromPool('hostnames', url) What do you think? |
Yes @christian-bromann that's similar to what I described in the I think the resource queue api would be easier to manage on the workers Other than those 2 API calls I would also need a way to configure: Possibly on the service setup: export const config = {
// ...
services: [
['shared-store', {
resourcePools: {
hostnames: ['url01.com', 'url02.com', 'url03.com']
// issue: if these values were fetched asynchronously,
// then it can't be done this way in the config file (sync)
}
}]
],
// ...
} Or on prepare: onPrepare() {
// these values can be fetched asynchronously
await setResourcePool('hostnames', ['url01.com', 'url02.com', 'url03.com']);
} And then usage beforeSession() {
const url = await getValueFromPool('hostnames') // one of ['url01.com', 'url02.com', 'url03.com']
}
afterSession() {
await releaseValueFromPool('hostnames', url)
} |
@Ajneesh21 note that @pedrorfernandes took the initiative to implement this. I am happy to assign a new task to you after you went through the workshop. |
Let's continue convo in #10029, thanks for taking a stab at this @pedrorfernandes |
Is your feature request related to a problem?
I have a test scenario where I need to access specific url's, e.g.:
['url01.com', 'url02.com', 'url03.com']
The wdio workers should share these URL's and never clash. Once a worker is finished, it "frees" up that url for another worker.
Possibly a better way to handle this is through network/load balancing, however I wanted to try this with
shared-data
service, setting up the url sharing between workers:This is basically a shared queue management problem between node worker threads
Describe the solution you'd like.
I could implement in
shared-store
another server operation'/compareAndSet'
to avoid collisions when writing datacompareAndSet(key, expectedValue, newValue)
only setsnewValue
ifexpectedValue
is the current value in the storeDescribe alternatives you've considered.
I thought about a different service where we just configure a queue of resources to be shared
[1, 2, 3, 4]
and the operations would just be/take
a resource and/return
a resource, this is easier on thebeforeSession
for each worker since the server would automatically dispense the value the worker needs and it doesn't need to retry until a value is freeAdditional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: