You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, sharing state between threads can be quite challenging because all threads run isolated from each other. Do you think it is possible to include a capability similar to Java’s ConcurrentHashMap to serve as a place to post a given variable or value visible to all running threads? This would greatly simplify some aspects of my testing.
Thank you very much for considering this request.
The text was updated successfully, but these errors were encountered:
Hello, not sure if this would be in scope of this library.
The issue with sharing context between tests is that they are non deterministic. There's no guarantee to the order in which tests start / complete etc.. so you may find issues with race conditions and asserting the wrong thing etc..
However you can implement this yourself to try out:
@CourgetteBeforeAllpublicstaticvoidsetUp() {
// start an in-memory database or any other type of persistence.inMemoryDB.create()
inMemoryDB.save('XYZ', 123)
}
@CourgetteAfterAllpublicstaticvoidtearDown() {
inMemoryDB.close()
}
@When("I retrieve the shared data for XYZ")
publicvoidretrieve_data() {
varsharedDataFromDB = inMemoryDB.get('XYZ');
assertEquals(sharedDataFromDB, 123);
}
Hi, Prashant. I hope you're doing well.
Currently, sharing state between threads can be quite challenging because all threads run isolated from each other. Do you think it is possible to include a capability similar to Java’s ConcurrentHashMap to serve as a place to post a given variable or value visible to all running threads? This would greatly simplify some aspects of my testing.
Thank you very much for considering this request.
The text was updated successfully, but these errors were encountered: