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

@Timeable(limit = 1, unit = TimeUnit.SECONDS) not working as expected #249

Open
santoshkumar-soma opened this issue Oct 10, 2017 · 6 comments

Comments

@santoshkumar-soma
Copy link

santoshkumar-soma commented Oct 10, 2017

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>
@0crat
Copy link

0crat commented Oct 10, 2017

@yegor256 please, pay attention to this issue

@yegor256
Copy link
Member

@santoshkumar-soma you should not forget about weaving: http://aspects.jcabi.com/example-weaving.html

@knmuni
Copy link

knmuni commented Mar 7, 2019

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>

@gbham
Copy link

gbham commented Nov 25, 2020

Experiencing same issue, anyone found a solution? I have tried adding the jcabi-maven-plugin as well.

@andreoss
Copy link
Collaborator

@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?

@gbham
Copy link

gbham commented May 22, 2021

I have long lost interest in using this method for timeouts.

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

No branches or pull requests

6 participants