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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added runtime dependency to fix the intermittent test failures #54587

Merged
merged 5 commits into from
Jun 23, 2021
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/mono/wasm/runtime/library_mono.js
Original file line number Diff line number Diff line change
Expand Up @@ -2365,12 +2365,14 @@ var MonoSupportLib = {
},

/**
* Loads the mono config file (typically called mono-config.json)
* Loads the mono config file (typically called mono-config.json) asynchroniously
* Note: the run dependencies are so emsdk actually awaits it in order.
*
* @param {string} configFilePath - relative path to the config file
* @throws Will throw an error if the config file loading fails
*/
mono_wasm_load_config: async function (configFilePath) {
mono_wasm_load_config: async function (configFilePath) {
Module.addRunDependency('mono-config.json');
Daniel-Genkin marked this conversation as resolved.
Show resolved Hide resolved
try {
let config = null;
// NOTE: when we add nodejs make sure to include the nodejs fetch package
Expand All @@ -2382,8 +2384,10 @@ var MonoSupportLib = {
} else { // shell or worker
config = JSON.parse(read(configFilePath)); // read is a v8 debugger command
}
Module.removeDependency('mono-config.json');
return config;
} catch(e) {
Module.removeDependency('mono-config.json');
return {message: "failed to load config file", error: e};
}
Daniel-Genkin marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down