Skip to content

Commit

Permalink
fix(tests): Fix race condition causing flakiness in PHP generator test (
Browse files Browse the repository at this point in the history
google#6213)

Turns out process.exit() was sometimes getting called before the
(async) fs.writeFile had finished writing the last of the generator
output files.
  • Loading branch information
cpcallen authored Jun 14, 2022
1 parent 307ff71 commit d7ab815
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/generators/run_generators_in_browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function runLangGeneratorInBrowser(browser, filename, codegenFn) {
await browser.execute(codegenFn);
var elem = await browser.$("#importExport");
var result = await elem.getValue();
fs.writeFile(filename, result, function(err) {
fs.writeFileSync(filename, result, function(err) {
if (err) {
return console.log(err);
}
Expand Down

0 comments on commit d7ab815

Please sign in to comment.