1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-05 09:18:06 +03:00

selftest: Remove reduction in time window in delaywrite test

This causes flakey autobuilds from time to time.

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

commit c2df97f57c
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 0d0fddf8ae
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 3aa7523d77)

and in:

commit edb3a83a06
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 751ab2992a)

Change-Id: I8ff9fb8a8b66308f6d784351a0f43b5b234889d1
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Andrew Bartlett 2014-03-27 14:52:26 +13:00 committed by Jeremy Allison
parent 547f682c15
commit 1bdc635f1d

View 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);