Skip to content

Commit

Permalink
Merge pull request webpack#17106 from webpack/ignore-unstable-coverage
Browse files Browse the repository at this point in the history
refactor: ignore unstable coverage
  • Loading branch information
TheLarkInn committed May 1, 2023
2 parents 30fbd1f + 8f6bdd4 commit 8ac68eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
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

0 comments on commit 8ac68eb

Please sign in to comment.