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

[Feature] memory bounded test #4

Open
augustindelecluse opened this issue Jan 12, 2024 · 0 comments
Open

[Feature] memory bounded test #4

augustindelecluse opened this issue Jan 12, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@augustindelecluse
Copy link
Collaborator

Problem

Some tests might use a large amount of memory, for instance for checking a DP model. With a wrong implementation, some students might explore too many states, filling up the memory of their machine or of a grading system.

Solution

Provide an annotation @MemoryLimit, where the test fails whenever the memory consumption is too high.
Example of usage:

@Test
@MemoryLimit(value = 200, units = MB)
public void test1() {
    infiniteDFS();
}

The test should fail with something similar to a MemoryConsumptionError

Ways for implementation

assertTimeoutPreemtively allows to kill a thread if its execution is above a given timed threshold. The mechanism could be use here, killing the thread if the memory consumption is too high. See

@augustindelecluse augustindelecluse added the enhancement New feature or request label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant