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

Minor fixes in test and readme #77

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,4 @@ To release a new version follow this step
* Try to follow semantic versioning, i.e. bump the major version for binary incompatible changes, the minor version for compatible changes with improvements/new features, and the patch version for bugfixes or non-functional changes like refactorings.
2. Merge your PR - the related pipeline will publish the new version(s) to Sonatype's staging repo (SNAPSHOTs are published directly to [their snapshots repo](https://s01.oss.sonatype.org/content/repositories/snapshots/)).
3. To publish a release, follow https://central.sonatype.org/publish/release/
4. Push the released version(s) to the next SNAPSHOT version (choose the next higher patch version for this) - totally fine to push this to master directly
4. Push the released version(s) to the next SNAPSHOT version (choose the next higher patch version for this) - totally fine to push this to main directly
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2022 Tomorrow GmbH @ https://tomorrow.one
/*
* Copyright 2023 Tomorrow GmbH @ https://tomorrow.one
Copy link
Contributor

@magro magro Mar 28, 2023

Choose a reason for hiding this comment

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

I think this should not be touched, AFAIK the year stands for the year when this file got publicly released.

It also breaks the licenseTest task, see the failed build... To relax the license plugin for new files in the future can probably be kept out of this here.

*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -91,21 +91,16 @@ public void should_RunWithLock_PreventLockStealing() throws ExecutionException,

CyclicBarrier barrier1 = new CyclicBarrier(2);
CyclicBarrier barrier2 = new CyclicBarrier(2);
CyclicBarrier barrier3 = new CyclicBarrier(2);

// when
Future<Boolean> runWithLockResult = executorService.submit(() -> {
Future<Boolean> runWithLockResult = executorService.submit(() -> lockService.runWithLock(ownerId1, () -> {
await(barrier1);
return lockService.runWithLock(ownerId1, () -> {
await(barrier2);
await(barrier3); // exit runWithLock not before owner2 has tried to "acquireOrRefreshLock"
});
});
await(barrier2); // exit runWithLock not before owner2 has tried to "acquireOrRefreshLock"
}));
Future<Boolean> lockStealingAttemptResult = executorService.submit(() -> {
await(barrier1);
await(barrier2); // start acquireOrRefreshLock not before owner1 is inside "runWithLock"
await(barrier1); // start acquireOrRefreshLock not before owner1 is inside "runWithLock"
boolean result = lockService.acquireOrRefreshLock(ownerId2);
await(barrier3);
await(barrier2);
return result;
});

Expand Down