selftest: Remove reduction in time window in delaywrite test
authorAndrew Bartlett <abartlet@samba.org>
Thu, 27 Mar 2014 01:52:26 +0000 (14:52 +1300)
committerJeremy Allison <jra@samba.org>
Tue, 1 Apr 2014 22:31:48 +0000 (00:31 +0200)
This causes flakey autobuilds from time to time.

The reduction in the time window to 30% was added in:

commit c2df97f57ce205935c37cd5a90cfeddb129cd92b
Author: Jeremy Allison <jra@samba.org>
Date:   Thu Nov 5 15:37:26 2009 -0800

    Fix up some of the timing constants for DELAYWRITE. Add some extra tests up test_delayed_write_update6
    to investigate what happens to a sticky write handle after a second handle close.
    Jeremy.

The original reduction to 75% was set in the new code

commit 0d0fddf8ae856efd7ffb07ba8fa32d2f55d3f9c0
Author: Jeremy Allison <jra@samba.org>
Date:   Fri Sep 5 14:24:36 2008 -0700

    Added tests that show that write time update is immediate
    when changing file size using SMBwrite of size zero,
    SET_END_OF_FILE, or SET_ALLOCATION_SIZE - no 2 second
    delay in these cases.
    Jeremy.
    (This used to be commit 3aa7523d7750fe30d1e6bb5a75ac42b681b9e493)

and in:

commit edb3a83a069d39e123f18de098cfaab6deb16729
Author: Stefan Metzmacher <metze@samba.org>
Date:   Tue Apr 8 10:25:51 2008 +0200

    BASE-DELAYWRITE: use timeval_* and make it possible to spefic the writetime update delay

    metze
    (This used to be commit 751ab2992afd13548af6e67a03d3ced566cb136f)

Change-Id: I8ff9fb8a8b66308f6d784351a0f43b5b234889d1
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/torture/basic/delaywrite.c

index da03b72d431078efba439fb738bc789fd6ae768a..5e05468ea6827eba92397efdeb82fe635b4027d9 100644 (file)
@@ -96,7 +96,7 @@ static bool test_delayed_write_update(struct torture_context *tctx, struct smbcl
                       nt_time_string(tctx, finfo2.basic_info.out.write_time));
                if (finfo1.basic_info.out.write_time != finfo2.basic_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff < (TIMEDELAY_SECS * sec * 0.3)) { /* 0.3 to cope with vmware timing */
+                       if (diff < (TIMEDELAY_SECS * sec)) {
                                torture_comment(tctx, "Server updated write_time after %.2f seconds"
                                                "(1 sec == %.2f)(wrong!)\n",
                                                diff, sec);
@@ -212,7 +212,7 @@ static bool test_delayed_write_update1(struct torture_context *tctx, struct smbc
                       nt_time_string(tctx, finfo2.all_info.out.write_time));
                if (finfo1.all_info.out.write_time != finfo2.all_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff > (0.25 * sec * 0.75)) { /* 0.75 to cope with vmware timing */
+                       if (diff > (0.25 * sec)) {
                                torture_comment(tctx, "After SMBwrite truncate "
                                        "server updated write_time after %.2f seconds"
                                        "(1 sec == %.2f)(wrong!)\n",
@@ -397,7 +397,7 @@ static bool test_delayed_write_update1a(struct torture_context *tctx, struct smb
                       nt_time_string(tctx, finfo2.all_info.out.write_time));
                if (finfo1.all_info.out.write_time != finfo2.all_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff > (0.25 * sec * 0.75)) { /* 0.75 to cope with vmware timing */
+                       if (diff > (0.25 * sec)) {
                                torture_comment(tctx, "After SMBwrite truncate "
                                        "server updated write_time after %.2f seconds"
                                        "(1 sec == %.2f)(wrong!)\n",
@@ -572,7 +572,7 @@ static bool test_delayed_write_update1b(struct torture_context *tctx, struct smb
                       nt_time_string(tctx, finfo2.all_info.out.write_time));
                if (finfo1.all_info.out.write_time != finfo2.all_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff > (0.25 * sec * 0.75)) { /* 0.75 to cope with vmware timing */
+                       if (diff > (0.25 * sec)) {
                                torture_result(tctx, TORTURE_FAIL, 
                                        "After SET_END_OF_FILE truncate "
                                        "server updated write_time after %.2f seconds"
@@ -751,7 +751,7 @@ static bool test_delayed_write_update1c(struct torture_context *tctx, struct smb
                       nt_time_string(tctx, finfo2.all_info.out.write_time));
                if (finfo1.all_info.out.write_time != finfo2.all_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff > (0.25 * sec * 0.75)) { /* 0.75 to cope with vmware timing */
+                       if (diff > (0.25 * sec)) {
                                torture_comment(tctx, "After SET_ALLOCATION_INFO truncate "
                                        "server updated write_time after %.2f seconds"
                                        "(1 sec == %.2f)(wrong!)\n",
@@ -1162,7 +1162,7 @@ static bool test_delayed_write_update2(struct torture_context *tctx, struct smbc
                       nt_time_string(tctx, finfo2.basic_info.out.write_time));
                if (finfo1.basic_info.out.write_time != finfo2.basic_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff < (TIMEDELAY_SECS * sec * 0.3)) { /* 0.3 to cope with vmware timing */
+                       if (diff < (TIMEDELAY_SECS * sec)) {
                                torture_comment(tctx, "Server updated write_time after %.2f seconds"
                                                "(1sec == %.2f) (wrong!)\n",
                                                diff, sec);
@@ -1543,7 +1543,7 @@ static bool test_delayed_write_update3(struct torture_context *tctx,
 
                if (finfo1.basic_info.out.write_time > finfo0.basic_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff < (TIMEDELAY_SECS * sec * 0.3)) { /* 0.3 to cope with vmware timing */
+                       if (diff < (TIMEDELAY_SECS * sec)) {
                                torture_comment(tctx, "Server updated write_time after %.2f seconds "
                                                "(1sec == %.2f) (wrong!)\n",
                                                diff, sec);
@@ -1705,7 +1705,7 @@ static bool test_delayed_write_update3a(struct torture_context *tctx,
 
                if (finfo1.basic_info.out.write_time > finfo0.basic_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff < (TIMEDELAY_SECS * sec * 0.3)) { /* 0.3 to cope with vmware timing */
+                       if (diff < (TIMEDELAY_SECS * sec)) {
                                torture_comment(tctx, "Server updated write_time after %.2f seconds "
                                                "(1sec == %.2f) (wrong!)\n",
                                                diff, sec);
@@ -1916,7 +1916,7 @@ static bool test_delayed_write_update3b(struct torture_context *tctx,
 
                if (finfo1.basic_info.out.write_time > finfo0.basic_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff < (TIMEDELAY_SECS * sec * 0.3)) { /* 0.3 to cope with vmware timing */
+                       if (diff < (TIMEDELAY_SECS * sec)) {
                                torture_comment(tctx, "Server updated write_time after %.2f seconds "
                                                "(1sec == %.2f) (wrong!)\n",
                                                diff, sec);
@@ -2285,7 +2285,7 @@ static bool test_delayed_write_update4(struct torture_context *tctx,
 
                if (finfo1.basic_info.out.write_time > finfo0.basic_info.out.write_time) {
                        double diff = timeval_elapsed(&start);
-                       if (diff < (TIMEDELAY_SECS * sec * 0.3)) { /* 0.3 to cope with vmware timing */
+                       if (diff < (TIMEDELAY_SECS * sec)) {
                                torture_comment(tctx, "Server updated write_time after %.2f seconds "
                                                "(1sec == %.2f) (wrong!)\n",
                                                diff, sec);