Repository navigation
[tests] Remove output-drain and build timestamp races - #13695
Draft
simonrozsival wants to merge 5 commits into
Draft
simonrozsival wants to merge 5 commits into
simonrozsival wants to merge 5 commits into
Conversation
simonrozsival
force-pushed
the
dev/simonrozsival/timing-incremental-output
branch
3 times, most recently
from
November 23, 2026 07:37
4bec3aa to
bee0f6f
Compare
7 tasks
Verify that output is captured and draining completes while the pipe-holding descendant is still alive. Use a generous hang watchdog instead of a narrow elapsed-time assertion, and clean up the test-owned descendant. Co-authored-by: Copilot App <[email protected]>
Give the alternate environment input a known old timestamp (also on the project item, so saving the project does not rewrite it) and compare native object contents after changing the managed build flavor. Co-authored-by: Copilot App <[email protected]>
Use the existing task-count and rule-content assertions to verify regeneration without requiring successive writes to have distinct timestamps. Co-authored-by: Copilot App <[email protected]>
Compare initial outputs against a sentinel on the same filesystem and give existing typemaps a known old timestamp before checking regeneration. Co-authored-by: Copilot App <[email protected]>
CheckTimestamps required every intermediate file to be newer than the start of the test. That blanket rule depends on how each tool preserves timestamps and is not a product contract. Its only targeted regeneration check covered typemap.mj/jm, which nothing in this repo produces, so that check never ran. The artifact-specific incremental build tests remain. Co-authored-by: Copilot App <[email protected]>
jonathanpeppers
force-pushed
the
dev/simonrozsival/timing-incremental-output
branch
from
November 23, 2026 14:55
a6aa483 to
b4cde4f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Elapsed-time and timestamp-order assertions can fail even when output handling and incremental builds are correct. Verify the observable process and build results instead.
Bootstrap output draining
Start a descendant that keeps redirected pipes open after its parent exits. Verify that the command's output is captured and draining returns while the descendant is still alive, with a generous hang watchdog and explicit cleanup. This checks that inherited handles do not stall the task without requiring an exact elapsed-time window.
NativeAOT object changes
Give the alternate environment input a known old timestamp and compare the native object contents after changing the managed build flavor. The test still checks that recompilation changed the object, without assuming that two writes receive distinct filesystem timestamps.
R8 rule regeneration
Keep the task-count and generated-rule-content assertions, and remove comparisons between successive write timestamps. Those existing assertions establish when R8 inputs were regenerated even on filesystems with coarse timestamp resolution.
Remove blanket build timestamp checks
Delete
BuildTest2.CheckTimestampsrather than stabilize its requirement that every intermediate file be newer than the start of the test. Tool-specific timestamp preservation and filesystem resolution make that blanket rule unreliable, and it is not a product contract. Its conditionaltypemap.mjandtypemap.jmregeneration checks have no producer in this repository; out-of-tree producers have not been assessed.The test also checked targets skipped by a no-change build. Artifact-specific tests such as
ProduceReferenceAssembly,LinkAssembliesNoShrink, andBasicApplicationRepetitiveReleaseBuildremain, but they are not exact replacements for every original assertion.BasicApplicationRepetitiveBuildis still ignored in this layer; #13698 proposes to re-enable it with functional incremental assertions. There is no replacement for the blanket intermediate-age assertion.Validation
Earlier validation was run with all five layers applied on macOS; intermediate branch heads were not built separately.
./dotnet-local.sh test bin/TestDebug/Microsoft.Android.Build.BaseTasks-Tests.dll --filter 'FullyQualifiedName~BootstrapProcessTests|Name~ProjectScopedRetries' -v minimal— passed (11 tests)../dotnet-local.sh test bin/TestDebug/MSBuildDeviceIntegration/net11.0/MSBuildDeviceIntegration.dll --filter 'Name~UnchangedProguardRulesDoNotRerunR8' -v minimal— passed (2 R8 modes)../dotnet-local.sh test bin/TestDebug/net11.0/Xamarin.Android.Build.Tests.dll --filter 'Name~BootstrapUpdatesForCommandLineFlavorChanges|Name~CheckTimestamps' -v minimal— passed (4 tests across CoreCLR and NativeAOT) beforeCheckTimestampswas deleted.The drain test establishes bounded completion while the descendant retains its handles; it does not enforce an exact one-second duration.
After the deletion, the #13695 test sources were checked out into a separate worktree and built against its existing Debug SDK; this was not a full checkout of the layer's product code. With
Vset to the session'sfiles/audit-deletionsdirectory:./dotnet-local.sh build src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Xamarin.Android.Build.Tests.csproj -bl:$V/13695-build.binlog— passed../dotnet-local.sh test bin/TestDebug/net11.0/Xamarin.Android.Build.Tests.dll --list-tests | grep -cE 'CheckTimestamps|ManagedParserGeneratesResourceClasses'— returned 0 matches../dotnet-local.sh test bin/TestDebug/net11.0/Xamarin.Android.Build.Tests.dll --filter 'FullyQualifiedName~Xamarin.Android.Build.Tests.ManagedResourceParserTests|Name~AaptRulesAreRegeneratedAfterDeletion|Name~ProduceReferenceAssembly|Name~LinkAssembliesNoShrink|Name~BasicApplicationRepetitiveBuild|Name~BootstrapUpdatesForCommandLineFlavorChanges' --logger "trx;LogFileName=13695-focused.trx" --results-directory $V— 26 passed, 0 failed, 3 skipped. BothBasicApplicationRepetitiveBuildvariants are ignored at this layer;ProduceReferenceAssembly(NativeAOT)was also skipped for an unconfirmed reason.