Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-71876

writeFile() shell helper errors when given relative path

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL

      https://parsley.mongodb.com/resmoke/1f6e1b36c547528b43d40fb62a7cb702/test/172d251d2c74a35cc5e2fa94ef12aafa?bookmarks=0,7873,8044&selectedLine=0

      [js_test:query_fuzzer-3cbd-1670031823821-0] Error: writeFile() can only write a file in a directory which already exists :
      [js_test:query_fuzzer-3cbd-1670031823821-0] writeOutput@jstestfuzz/out/query_fuzzer-3cbd-1670031823821-0.js:1641:11
      [js_test:query_fuzzer-3cbd-1670031823821-0] minimizeOutput@jstestfuzz/out/query_fuzzer-3cbd-1670031823821-0.js:3731:16
      [js_test:query_fuzzer-3cbd-1670031823821-0] main@jstestfuzz/out/query_fuzzer-3cbd-1670031823821-0.js:3792:23
      [js_test:query_fuzzer-3cbd-1670031823821-0] @jstestfuzz/out/query_fuzzer-3cbd-1670031823821-0.js:3805:1
      [js_test:query_fuzzer-3cbd-1670031823821-0] @jstestfuzz/out/query_fuzzer-3cbd-1670031823821-0.js:3807:2
      [js_test:query_fuzzer-3cbd-1670031823821-0] failed to load: jstestfuzz/out/query_fuzzer-3cbd-1670031823821-0.js
      [js_test:query_fuzzer-3cbd-1670031823821-0] exiting with code -3 

      The writeOutput function is

      export function writeOutput(minimizerOutputs: MinimizedOutputs) {
          try {
              shell.removeFile('./minimizer-outputs.json');
          } catch (_) {
              // pass
          }
          shell.writeFile(
              './minimizer-outputs.json',
              JSON.stringify(formatMinimizedOutputs(minimizerOutputs))
          );
      } 

            Assignee:
            alex.neben@mongodb.com Alex Neben
            Reporter:
            zixuan.zhuang@mongodb.com Zixuan Zhuang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: