You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:
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. SeeFuture<T>
-like class, with a method get() killing the thread if the memory consumption is too highThe text was updated successfully, but these errors were encountered: