From: Jeff Layton <jlayton@kernel.org>
To: Scott Mayhew <smayhew@redhat.com>,
calum.mackay@cdmnet.org, cel@kernel.org
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] pynfs: fix testLeasePeriod sleep with short lease periods
Date: Fri, 20 Nov 2026 10:42:55 -0800 [thread overview]
Message-ID: <f4af55cdb059b5e9224282a40f32431bcbc3d4ad.camel@kernel.org> (raw)
In-Reply-To: <20261120174838.45668-1-smayhew@redhat.com>
On Fri, 2026-11-20 at 12:48 -0500, Scott Mayhew wrote:
> testLeasePeriod() computed its in-lease sleep as min(lease - 10, 1),
> which goes negative when the server's lease period is less than 10
> seconds, causing time.sleep() to raise "ValueError: sleep length must
> be non-negative". Clamp the sleep to a non-negative value.
>
> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> ---
> Note: knfsd doesn't allow the lease time to be less than 10 seconds, but
> Hammerspace does.
>
> nfs4.1/server41tests/st_exchange_id.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/nfs4.1/server41tests/st_exchange_id.py b/nfs4.1/server41tests/st_exchange_id.py
> index acb1a93..66053fa 100644
> --- a/nfs4.1/server41tests/st_exchange_id.py
> +++ b/nfs4.1/server41tests/st_exchange_id.py
> @@ -498,7 +498,7 @@ def testLeasePeriod(t, env):
> # CREATE_SESSION
> chan_attrs = channel_attrs4(0,8192,8192,8192,128,8,[])
> sec = [callback_sec_parms4(0)]
> - time.sleep(min(lease - 10, 1))
> + time.sleep(max(0, min(lease - 10, 1)))
> # Inside lease period, create_session will success.
> res1 = c1.c.compound([op.create_session(c1.clientid, c1.seqid, 0,
> chan_attrs, chan_attrs,
Reviewed-by: Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2026-11-20 18:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 17:48 [PATCH] pynfs: fix testLeasePeriod sleep with short lease periods Scott Mayhew
2026-11-20 18:42 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f4af55cdb059b5e9224282a40f32431bcbc3d4ad.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=calum.mackay@cdmnet.org \
--cc=cel@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=smayhew@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox