Skip to content

Commit

Permalink
Still debugging race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
JustusAdam committed Jul 22, 2024
1 parent d13d176 commit 75dafe0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
key: ${{ runner.os }}-rust-deps-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
- name: Flowistry Tests
run: cargo test -p flowistry_pdg -p flowistry_pdg_construction
- name: Async through another layer standalone
run: cargo test --test async_tests -- selector_async_through_another_layer
- name: Racing tests together
run: cargo test --test async_tests -- selector
- name: Paralegal flow tests
run: cargo test -p paralegal-flow -p paralegal-spdg
- name: Paralegal Policy Tests
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ debug = true
[replace."rustc_utils:0.7.4-nightly-2023-08-25"]
# path = "../rustc_plugin/crates/rustc_utils"
git = "https://github.com/JustusAdam/rustc_plugin"
rev = "da742667ec1c62e85fab41fb15634f648345469c"
rev = "6dcee5d8758f8ac456209e95dfa25e03142295f1"

[replace."rustc_plugin:0.7.4-nightly-2023-08-25"]
# path = "../rustc_plugin/crates/rustc_plugin"
git = "https://github.com/JustusAdam/rustc_plugin"
rev = "da742667ec1c62e85fab41fb15634f648345469c"
rev = "6dcee5d8758f8ac456209e95dfa25e03142295f1"
11 changes: 10 additions & 1 deletion crates/paralegal-flow/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extern crate rustc_middle;
extern crate rustc_span;

use hir::def_id::DefId;
use rustc_utils::mir::borrowck_facts;

use crate::{
desc::{Identifier, ProgramDescription},
Expand Down Expand Up @@ -241,12 +242,20 @@ impl InlineTestBuilder {
.map(ToOwned::to_owned),
)
.compile(move |result| {
println!(
"MIR cache before test has {} entries",
borrowck_facts::MIR_BODIES.with(|b| b.len())
);
let tcx = result.tcx;
let memo = crate::Callbacks::new(Box::leak(Box::new(args)));
let pdg = memo.run(tcx).unwrap();
let graph = PreFrg::from_description(pdg);
let cref = graph.ctrl(&self.ctrl_name);
check(cref)
check(cref);
println!(
"MIR cache after test has {} entries",
borrowck_facts::MIR_BODIES.with(|b| b.len())
);
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/paralegal-flow/tests/async_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ define_test!(markers: graph -> {
});

#[test]
fn await_on_generic() {
fn selector_await_on_generic() {
InlineTestBuilder::new(stringify!(
use std::{
future::{Future},
Expand Down Expand Up @@ -354,7 +354,7 @@ fn await_with_inner_generic_constrained() {
}

#[test]
fn async_through_another_layer() {
fn selector_async_through_another_layer() {
InlineTestBuilder::new(stringify!(
async fn maker(x: u32, y: u32) -> u32 {
x
Expand Down

0 comments on commit 75dafe0

Please sign in to comment.