owncloud-archive / files_locking

3 stars 5 forks source link

Ideas to automate testing on this app? #37

Open jvillafanez opened 9 years ago

jvillafanez commented 9 years ago

Consider the following test scenario:

  1. User 1 uploads a file
  2. User 2 tries to delete the uploaded file at the same time.

We have 3 possible results, depending (partially) in the request order:

  1. File is uploaded and then deleted
  2. File is uploaded, and the delete request fails because the file is locked
  3. Delete request fails because the file is missing (upload request hasn't reach the server yet), and then the file is upload correctly.

This mean that, currently, we don't have a way to ensure that the second request will get a locked exception. There are a lot of uncertainty.

Some ideas:

I don't think it's possible to test this app in a reliable way without some extra help.

PD: I miss the "discussion" label here

jvillafanez commented 9 years ago

@icewind1991 @PVince81 @jnfrmarks join the discussion :smiley:

jnfrmarks commented 9 years ago

Thanks for entering this!

In previous engagements when I had to test things like this, the development team was able to insert private apis in the product to allow for sleeping or some such thing so that the testing could simulate the lock.

See also https://github.com/owncloud/smashbox/issues/94 - it may be that these are both the same, one from the server point of view, the other from test tool POV.

I believe that we need to come up with some approach so that testing can be automated.

PVince81 commented 9 years ago

@jvillafanez please do not confuse the "files_locking" app with the new experimental file locking.

But your test case if valid. I'm pretty sure that any concurrency case will not be covered properly by this old files_locking app. but should work properly in the new one.