Skip to content

util::local_poll_adapter::tests::deferred_success test looks little bit too flaky #16907

@motorailgun

Description

@motorailgun

Problem

Test for utility LocalPollAdapter, util::local_poll_adapter::tests::deferred_success is failing multiple times on CI but re-running doesn't (or maybe sometimes does) reproduce the failure.

Recently failed runs:

Possible cause is that short waiting time here might be causing Future to immediately returning Ready:

futures_timer::Delay::new(Duration::from_millis(1)).await

and thus poll() returns Ready.

// Attempt to run the future immediately. If it has no `await` yields,
// it will return here.
if let Some((k, v)) = (&mut future).now_or_never() {
if let Ok(success) = &v {
// Only cache successful results.
self.cache.insert(k, Poll::Ready(Ok(success.clone())));
}
return Poll::Ready(v);
}

Steps

No response

Possible Solution(s)

No response

Notes

I can't reproduce this on local.

#!/bin/bash

set -xe

for i in `seq 100`
do
	echo test $i
	cargo test util::local_poll_adapter::tests::deferred_success
done

Version

CI, and local:

cargo 1.97.0-nightly (eb94155a9 2026-04-09)
release: 1.97.0-nightly
commit-hash: eb94155a9a60943bd7b1cb04abec42f5d0de6ddc
commit-date: 2026-04-09
host: x86_64-unknown-linux-gnu
libgit2: 1.9.2 (sys:0.20.4 vendored)
libcurl: 8.19.0-DEV (sys:0.4.87+curl-8.19.0 vendored ssl:OpenSSL/3.5.4)
ssl: OpenSSL 3.5.4 30 Sep 2025
os: Arch Linux [64-bit]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testing-cargo-itselfArea: cargo's testsC-bugCategory: bugS-needs-infoStatus: Needs more info, such as a reproduction or more background for a feature request.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions