Remove panic in ConsumeCoverageData() when no coverage is observed.

A call to ConsumeCoverageData() can observe zero incremental coverage
immediately after a concurrent call to ConsumeCoverageData() unlocks coverageMu
if sync.Mutex.Lock/Unlock are excluded from coverage instrumentation.

PiperOrigin-RevId: 549119637
This commit is contained in:
Jamie Liu
2023-07-18 14:57:13 -07:00
committed by gVisor bot
parent 14df01fae6
commit f43a5fc63a
-5
View File
@@ -183,11 +183,6 @@ func ConsumeCoverageData(w io.Writer) int {
}
}
if total == 0 {
// An empty profile indicates that coverage is not enabled, in which case
// there shouldn't be any task work registered.
panic("kcov task work is registered, but no coverage data was found")
}
return total
}