jcabi-aspects
jcabi-aspects copied to clipboard
@Timeable(limit = 1, unit = TimeUnit.SECONDS) not working as expected
I have tried to use this annotation with my java method but it not timinout.
Please find the below java method .
public static void main(String[] args) throws InterruptedException{
test();
}
@Loggable
@Timeable(limit = 1, unit = TimeUnit.SECONDS)
public static void test() throws InterruptedException{
System.out.println("Start");
Thread.sleep(1000000);
System.out.println("End");
}
Note: I am using below maven dependancy.
<groupId>com.jcabi</groupId>
<artifactId>jcabi-maven-plugin</artifactId>
<version>0.14</version>
@yegor256 please, pay attention to this issue
@santoshkumar-soma you should not forget about weaving: http://aspects.jcabi.com/example-weaving.html
Hi ,
Its not working
public static void main(String[] args) throws InterruptedException{
test();
}
@Loggable
@Timeable(limit = 1, unit = TimeUnit.SECONDS)
public static void test() throws InterruptedException{
System.out.println("Start");
Thread.sleep(1000000);
System.out.println("End");
}
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-aspects</artifactId>
<version>0.22.6</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.12</version>
<scope>runtime</scope>
</dependency>
</dependencies>
Experiencing same issue, anyone found a solution? I have tried adding the jcabi-maven-plugin as well.
@gbham Can you provide a small reproducible it case familiar to https://github.com/jcabi/jcabi-aspects/tree/master/src/it/loggable to confirm this bug on the current master?
I have long lost interest in using this method for timeouts.