Strokes are roughly twice more likely to be missed among Black patients, with most of the disparity arising from physicians testing Black patients less often. We develop a method to quantify the role of disparate treatment by physicians in driving this difference in testing. Specifically, we leverage a unique feature of strokes: whether a patient actually had a stroke can be inferred retrospectively even if initially misdiagnosed. This allows us to benchmark testing decisions against racially objective predictions of stroke risk made by a machine learning model trained on the true underlying stroke states. We decompose disparate treatment into two forces: an unjustified skill gap, where physicians make noisier risk assessments for Black patients; and racial prejudice, where physicians are less likely to test Black patients conditional on their risk assessment. Disparate treatment accounts for about 65% of the racial disparity in testing. Removing racial prejudice would lower testing disparities by half.