Skip to content

Commit

Permalink
mark timestamp query inside encoders/passes tests as flaky (#5838)
Browse files Browse the repository at this point in the history
  • Loading branch information
teoxoy authored Jun 19, 2024
1 parent 14e7502 commit 1904822
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions examples/src/timestamp_queries/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ pub fn main() {

#[cfg(test)]
mod tests {
use wgpu_test::{gpu_test, GpuTestConfiguration};
use wgpu_test::{gpu_test, FailureCase, GpuTestConfiguration};

use super::{submit_render_and_compute_pass_with_queries, QueryResults};

Expand All @@ -456,7 +456,9 @@ mod tests {
.features(
wgpu::Features::TIMESTAMP_QUERY
| wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS,
),
)
// see https://github.com/gfx-rs/wgpu/issues/2521
.expect_fail(FailureCase::always().panic("unexpected timestamp").flaky()),
)
.run_sync(|ctx| test_timestamps(ctx, true, false));

Expand All @@ -469,7 +471,9 @@ mod tests {
wgpu::Features::TIMESTAMP_QUERY
| wgpu::Features::TIMESTAMP_QUERY_INSIDE_ENCODERS
| wgpu::Features::TIMESTAMP_QUERY_INSIDE_PASSES,
),
)
// see https://github.com/gfx-rs/wgpu/issues/2521
.expect_fail(FailureCase::always().panic("unexpected timestamp").flaky()),
)
.run_sync(|ctx| test_timestamps(ctx, true, true));

Expand Down Expand Up @@ -497,16 +501,31 @@ mod tests {
let encoder_delta = encoder_timestamps[1].wrapping_sub(encoder_timestamps[0]);

if timestamps_on_encoder {
assert!(encoder_delta > 0);
assert!(encoder_delta >= render_delta + compute_delta);
assert!(encoder_delta > 0, "unexpected timestamp");
assert!(
encoder_delta >= render_delta + compute_delta,
"unexpected timestamp"
);
}
if let Some(render_inside_timestamp) = render_inside_timestamp {
assert!(render_inside_timestamp >= render_start_end_timestamps[0]);
assert!(render_inside_timestamp <= render_start_end_timestamps[1]);
assert!(
render_inside_timestamp >= render_start_end_timestamps[0],
"unexpected timestamp"
);
assert!(
render_inside_timestamp <= render_start_end_timestamps[1],
"unexpected timestamp"
);
}
if let Some(compute_inside_timestamp) = compute_inside_timestamp {
assert!(compute_inside_timestamp >= compute_start_end_timestamps[0]);
assert!(compute_inside_timestamp <= compute_start_end_timestamps[1]);
assert!(
compute_inside_timestamp >= compute_start_end_timestamps[0],
"unexpected timestamp"
);
assert!(
compute_inside_timestamp <= compute_start_end_timestamps[1],
"unexpected timestamp"
);
}
}
}

0 comments on commit 1904822

Please sign in to comment.