[GH-ISSUE #2901] [Bug] Integration tests are broken on Windows #1272

Closed
opened 2026-03-23 20:47:13 +00:00 by mirror · 2 comments
Owner

Originally created by @a-wallen on GitHub (Jun 25, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2901

Bug Description

Some integration tests on Windows have been broken since I started work here, but I needed help figuring out why. While I was working on adding custom fonts to AppFlowy, I realized that there was a problem with the following that I think causes the issue

  static Future<Directory> testLocation(String? name) async {
    final dir = await getApplicationDocumentsDirectory();
    var path = '${dir.path}/flowy_test';
    if (name != null) {
      path += '/$name';
    }
    return Directory(path).create(recursive: true);
  }

How to Reproduce

Any integration test that depends on TestFolder seems to be affected.

Expected Behavior

Tests pass on macOS and linux because the platform file separator is / and not \

Operating System

Windows

AppFlowy Version(s)

main

Screenshots

No response

Additional Context

No response

Originally created by @a-wallen on GitHub (Jun 25, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2901 ### Bug Description Some integration tests on Windows have been broken since I started work here, but I needed help figuring out why. While I was working on adding custom fonts to AppFlowy, I realized that there was a problem with the following that I think causes the issue ```dart static Future<Directory> testLocation(String? name) async { final dir = await getApplicationDocumentsDirectory(); var path = '${dir.path}/flowy_test'; if (name != null) { path += '/$name'; } return Directory(path).create(recursive: true); } ``` ### How to Reproduce Any integration test that depends on `TestFolder` seems to be affected. ### Expected Behavior Tests pass on macOS and linux because the platform file separator is `/` and not `\` ### Operating System Windows ### AppFlowy Version(s) main ### Screenshots _No response_ ### Additional Context _No response_
Author
Owner

@a-wallen commented on GitHub (Jun 25, 2023):

I just checked whether the platform path separator was the issue, and it turns out that the tests fail because the process cannot delete the test location because the application is still running during the teardown phase and has the test location open.

<!-- gh-comment-id:1606287027 --> @a-wallen commented on GitHub (Jun 25, 2023): I just checked whether the platform path separator was the issue, and it turns out that the tests fail because the process cannot delete the test location because the application is still running during the teardown phase and has the test location open.
Author
Owner

@a-wallen commented on GitHub (Jun 25, 2023):

AppFlowy.exe can't be terminated to release the file handles because the way that some tests are written require the application to be open.

<!-- gh-comment-id:1606327680 --> @a-wallen commented on GitHub (Jun 25, 2023): AppFlowy.exe can't be terminated to release the file handles because the way that some tests are written require the application to be open.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#1272
No description provided.