Skip to content

Proper test cleanup and resolve EOF Error#218

Merged
thodkatz merged 3 commits intoilastik:mainfrom
thodkatz:fix-eof
Sep 12, 2024
Merged

Proper test cleanup and resolve EOF Error#218
thodkatz merged 3 commits intoilastik:mainfrom
thodkatz:fix-eof

Conversation

@thodkatz
Copy link
Collaborator

@thodkatz thodkatz commented Sep 9, 2024

As I am trying to migrate to github actions (#217), I have realized two issues when running the tests:

  • Tests don't terminate when one of them fails (pytest is hanging)
  • Even when the tests pass, we are getting EOF Errors.

I have attempt to resolve these issue with their respective commits :)

Currently pytest hangs if a test fails, because resources are not cleaned up. Use a fixture to auto-clean during the teardown of the test.
Currently when creating a pipe, the server doesn't close the connection nor the created thread when the listening loop exits. This results to EOFError as we can see in the output when running the tests.
@thodkatz
Copy link
Collaborator Author

thodkatz commented Sep 9, 2024

CI is failing because it gets a cached environment with these packages installed

bioimageio-core           0.6.7                    pypi_0    pypi
bioimageio-spec           0.5.3.post4              pypi_0    pypi

, maybe coming from the PR of updating the submodules to v5.

@thodkatz thodkatz force-pushed the fix-eof branch 11 times, most recently from bb25012 to 791e998 Compare September 10, 2024 09:42
- remove cleaning build files, `pip install -e` should be used
- `pip install -e` doesn't work with multiple files, use a for loop to
  install the submodules
Copy link
Collaborator

@k-dominik k-dominik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, thank you for fixing this. I also appreciate the renamed variables, makes it easier to follow :)

Also really great that you added the proper cleanup in the rpc!

Comment on lines +78 to +89
def list_available_devices(self) -> List[IDevice]:
"""
List available devices on server
"""
return [device for device in self.list_devices() if device.status == DeviceStatus.AVAILABLE]

def list_reserved_devices(self) -> List[IDevice]:
"""
List reserved devices on server
"""
return [device for device in self.list_devices() if device.status == DeviceStatus.IN_USE]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see the value of adding these, but as far as I can tell they are not used. The commit message doesn't really explain why these have been added. So no context other than "nice to have" as far as I can see.

Copy link
Collaborator Author

@thodkatz thodkatz Sep 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is being used here https://github.com/ilastik/tiktorch/pull/218/files#diff-31a22ff2b156f62383aa4c24cb4bf40cd11cf238819548c8c29dc51e7dd0d4a0R63, I wanted to assert that there aren't any reserved devices. Then we would have a function for getting all the devices, and one to get the reserved ones. For consistency, I have added to be able to get all the available ones as well, but it is true isn't used. I could remove it.

@thodkatz thodkatz merged commit 3eb9148 into ilastik:main Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants