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

Flakey dataDirectory test failure #1655

Closed
teamdandelion opened this issue Feb 9, 2020 · 1 comment · Fixed by #1731
Closed

Flakey dataDirectory test failure #1655

teamdandelion opened this issue Feb 9, 2020 · 1 comment · Fixed by #1731
Assignees
Labels
bug Something isn't working

Comments

@teamdandelion
Copy link
Contributor

While working on a totally unrelated change, I saw the following failure on dataDirectory.test.js:

    FAIL src/backend/dataDirectory.test.js
      ● src/backend/dataDirectory › DataDirectory › DataDirectory.storeProject › should work whe
n sourcecredDirectory doesn't exist

        SyntaxError: Unexpected end of JSON input
            at JSON.parse (<anonymous>)

          140 |         const expectJSONFile = async (name: string, expected: any) => {
          141 |           const filePath = path.join(expectedProjectDirectory, name);
        > 142 |           const actual = JSON.parse(await fs.readFile(filePath));
              |                               ^
          143 |           expect(actual).toEqual(expected);
          144 |         };

I have no reproduction.

cc @Beanow, who wrote the test in question.

@teamdandelion teamdandelion added bug Something isn't working build the build is, by some, considered VERY imjportant labels Feb 9, 2020
@Beanow
Copy link
Contributor

Beanow commented Feb 9, 2020

Time to swap them for compatIO 😅

@Beanow Beanow self-assigned this Feb 9, 2020
Beanow added a commit that referenced this issue Mar 28, 2020
Though we don't return any value, we should wait till we've completed
the file I/O. This likely caused the flake from #1655. As we didn't
await the write, it caused a race condition where we tried to read first.

Fixes #1655
@Beanow Beanow removed the build the build is, by some, considered VERY imjportant label Mar 28, 2020
Beanow added a commit that referenced this issue Mar 30, 2020
Though we don't return any value, we should wait till we've completed
the file I/O. This likely caused the flake from #1655. As we didn't
await the write, it caused a race condition where we tried to read first.

Fixes #1655
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants