Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: ignore unstable coverage #17106

Merged
merged 2 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Compilation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2578,6 +2578,8 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
p.calculate();

const logger = this.getLogger("webpack.Compilation.ModuleProfile");
// Avoid coverage problems due indirect changes
/* istanbul ignore next */
const logByValue = (value, msg) => {
if (value > 1000) {
logger.error(msg);
Expand Down
2 changes: 2 additions & 0 deletions lib/cache/MemoryWithGcCachePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class MemoryWithGcCachePlugin {
generation++;
let clearedEntries = 0;
let lastClearedIdentifier;
// Avoid coverage problems due indirect changes
/* istanbul ignore next */
for (const [identifier, entry] of oldCache) {
if (entry.until > generation) break;

Expand Down
2 changes: 2 additions & 0 deletions lib/debug/ProfilingPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ class Profiler {
return this.sendCommand("Profiler.stop").then(({ profile }) => {
const hrtime = process.hrtime();
const endTime = hrtime[0] * 1000000 + Math.round(hrtime[1] / 1000);
// Avoid coverage problems due indirect changes
/* istanbul ignore next */
if (profile.startTime < this._startTime || profile.endTime > endTime) {
// In some cases timestamps mismatch and we need to adjust them
// Both process.hrtime and the inspector timestamps claim to be relative
Expand Down