Skip to content

Commit

Permalink
Advance by 1ms
Browse files Browse the repository at this point in the history
This gets rid of the blocking behavior I was seeing, but ends up
breaking, at least one of, the tests:

```
Running test in "tests/data/adaptive-concurrency/constant-link.toml"
Comparison failed: controller observed_rtt max = 0.103; maximum = 0.102
Comparison failed: controller observed_rtt mean = 0.10200030637254906; maximum = 0.102
Comparison failed: controller averaged_rtt max = 0.10203225806451613; maximum = 0.102
Comparison failed: controller averaged_rtt mean = 0.10200104058272637; maximum = 0.102
thread 'sinks::util::adaptive_concurrency::tests::all_tests' panicked at 'TestResults {
    stats: Statistics {
        completed: 500,
        in_flight: LevelTimeHistogram {
            level: 0,
            histogram: TimeHistogram {
                histogram: Histogram {
                    totals: [
                        0.0,
                        0.204,
                        0.102,
                        0.203,
                        0.103,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                        0.102,
                    ],
                },
                last_time: Some(
                    Instant {
                        t: 587447403828567,
                    },
                ),
            },
        },
        rate: Some(
            HistogramStats {
                min: 1,
                max: 246,
                mode: 243,
                total: 3.365999999999999,
                mean: 111.03713606654783,
            },
        ),
        requests: 223,
    },
    cstats: ControllerStatistics {
        in_flight: TimeHistogram {
            histogram: Histogram {
                totals: [
                    0.0,
                    0.204,
                    0.102,
                    0.203,
                    0.103,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                ],
            },
            last_time: Some(
                Instant {
                    t: 587447403828567,
                },
            ),
        },
        concurrency_limit: TimeHistogram {
            histogram: Histogram {
                totals: [
                    0.0,
                    0.0,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                    0.102,
                ],
            },
            last_time: Some(
                Instant {
                    t: 587447403828567,
                },
            ),
        },
        observed_rtt: TimeWeightedSum {
            sum: WeightedSum {
                total: 0.3329290000000001,
                weights: 3.2639999999999993,
                min: Some(
                    0.102,
                ),
                max: Some(
                    0.103,
                ),
            },
            last_observation: Some(
                Instant {
                    t: 587447403828567,
                },
            ),
        },
        averaged_rtt: TimeWeightedSum {
            sum: WeightedSum {
                total: 0.3225272903225807,
                weights: 3.1619999999999995,
                min: Some(
                    0.102,
                ),
                max: Some(
                    0.10203225806451613,
                ),
            },
            last_observation: Some(
                Instant {
                    t: 587447403828567,
                },
            ),
        },
    },
}', src/sinks/util/adaptive_concurrency/tests.rs:608:5
```

Signed-off-by: Jesse Szwedko <jesse@szwedko.me>
  • Loading branch information
jszwedko committed Jun 22, 2021
1 parent 7e69154 commit 7be7347
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sinks/util/adaptive_concurrency/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ async fn run_test(params: TestParams) -> TestResults {
// This is crude and dumb, but it works, and the tests run fast and
// the results are highly repeatable.
while stats.lock().expect("Poisoned stats lock").completed < params.requests {
time::advance(Duration::from_millis(0)).await;
time::advance(Duration::from_millis(1)).await;
}
topology.stop().await;

Expand Down

0 comments on commit 7be7347

Please sign in to comment.