]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture: avoid OPLOCK-CANCEL flapping on busy gitlab CI
authorRalph Boehme <slow@samba.org>
Mon, 16 Nov 2020 09:44:48 +0000 (10:44 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 19 Nov 2020 20:00:38 +0000 (20:00 +0000)
I saw this test fail a few times on gitlab CI with
NT_STATUS_SHARING_VIOLATION:

  Running OPLOCK-CANCEL
  cli_unlink failed: NT_STATUS_SHARING_VIOLATION
  TEST OPLOCK-CANCEL FAILED!

The only possible explanation I could come up for
this flapping test is that the fnum1 filehandle in cli1 is still not closed when
cli2 tries to open the file deletion 5 seconds after cli1 is thrown away. As
fnum1 doesn't have FILE_SHARE_DELELE the open-for-delete fails with a
SHARING_VIOLATION.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/torture/test_oplock_cancel.c

index b003876f59281ebf7f909a4bd7123368462a2c78..86ce5b76d77c1982f69172e7cc5da9a435afce0e 100644 (file)
@@ -148,6 +148,8 @@ bool run_oplock_cancel(int dummy)
                return false;
        }
 
+       cli_close(cli1, fnum1);
+
        TALLOC_FREE(cli1);
 
        /*