Skip to content

Commit

Permalink
add new EndOfTestResults event
Browse files Browse the repository at this point in the history
Summary: It would be useful to debug issues like S469843 where test command is not finishing.

Reviewed By: samkevich

Differential Revision: D66479916

fbshipit-source-id: d195541811502a54c1a0e77772f6a0c95449876f
  • Loading branch information
blackm00n authored and facebook-github-bot committed Nov 26, 2024
1 parent f556953 commit fba080f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/buck2_data/data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,17 @@ message InstantEvent {
// Just something for us to be able to easily propagate out internal
// information. Used for testing.
QuickUnstableE2eData unstable_e2e_data = 44;

/// Notification that execution of all tests for a given command is
/// finished.
EndOfTestResults end_of_test_results = 45;
}
}

message EndOfTestResults {
int32 exit_code = 1;
}

// This should only be used as a mechanism to easily get information into the
// event log for e2e tests.
message QuickUnstableE2eData {
Expand Down
2 changes: 2 additions & 0 deletions app/buck2_test/src/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ use buck2_core::pattern::pattern_type::TargetPatternExtra;
use buck2_core::provider::label::ConfiguredProvidersLabel;
use buck2_core::target::configured_or_unconfigured::ConfiguredOrUnconfiguredTargetLabel;
use buck2_core::target::configured_target_label::ConfiguredTargetLabel;
use buck2_data::EndOfTestResults;
use buck2_data::SetupLocalResourcesEnd;
use buck2_data::SetupLocalResourcesStart;
use buck2_data::TestDiscovery;
Expand Down Expand Up @@ -714,6 +715,7 @@ impl<'a> TestOrchestrator for BuckTestOrchestrator<'a> {
}

async fn end_of_test_results(&self, exit_code: i32) -> anyhow::Result<()> {
self.events.instant_event(EndOfTestResults { exit_code });
self.results_channel
.unbounded_send(Ok(ExecutorMessage::ExitCode(exit_code)))
.map_err(|_| anyhow::Error::msg("end_of_tests was received twice"))?;
Expand Down

0 comments on commit fba080f

Please sign in to comment.