Skip to content

Commit

Permalink
Add a workaround for k/js and k/wasm tests flakiness from https://and…
Browse files Browse the repository at this point in the history
  • Loading branch information
eymar committed Dec 17, 2024
1 parent ff2a4b4 commit 1a71cd7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion mpp/karma.config.d/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@ config.customLaunchers = {
}
}

config.browsers = ["ChromeForComposeTests"]
config.browsers = ["ChromeForComposeTests"];

// A workaround from https://android-review.googlesource.com/c/platform/frameworks/support/+/3413540
(function() {
const originalExit = process.exit;
process.exit = function(code) {
console.log('Delaying exit for logs...');
// This extra time allows any pending I/O operations (such as printing logs) to complete,
// preventing flakiness when Kotlin marks a test as complete.
setTimeout(() => {
originalExit(code);
}, 5000);
};
})();
15 changes: 14 additions & 1 deletion mpp/karma.config.d/wasm/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,17 @@ config.customLaunchers = {
}
}

config.browsers = ["ChromeForComposeTests"]
config.browsers = ["ChromeForComposeTests"];

// A workaround from https://android-review.googlesource.com/c/platform/frameworks/support/+/3413540
(function() {
const originalExit = process.exit;
process.exit = function(code) {
console.log('Delaying exit for logs...');
// This extra time allows any pending I/O operations (such as printing logs) to complete,
// preventing flakiness when Kotlin marks a test as complete.
setTimeout(() => {
originalExit(code);
}, 5000);
};
})();

0 comments on commit 1a71cd7

Please sign in to comment.