Skip to content

Commit

Permalink
java-cdk: fix broken test due to merge skew (#30829)
Browse files Browse the repository at this point in the history
  • Loading branch information
postamar authored Sep 28, 2023
1 parent f1eca76 commit de6652f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
# TODO: be able to remove the skipSlowTests property
# TODO: remove the format task ASAP
# TODO: roll the CDK tasks into check
arguments: --scan --no-daemon --no-watch-fs format check :airbyte-cdk:java:airbyte-cdk:build :airbyte-cdk:java:airbyte-cdk:integrationTest -DskipSlowTests=true
arguments: --scan --no-daemon --no-watch-fs format check -DskipSlowTests=true

# In case of self-hosted EC2 errors, remove this block.
stop-check-runner:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@

public class GlobalMemoryManagerTest {

private static final long BYTES_10_MB = 10 * 1024 * 1024;
private static final long BYTES_35_MB = 35 * 1024 * 1024;
private static final long BYTES_5_MB = 5 * 1024 * 1024;
private static final long BYTES_MB = 1024 * 1024;

@Test
void test() {
final GlobalMemoryManager mgr = new GlobalMemoryManager(BYTES_35_MB);
final GlobalMemoryManager mgr = new GlobalMemoryManager(35 * BYTES_MB);

assertEquals(BYTES_10_MB, mgr.requestMemory());
assertEquals(BYTES_10_MB, mgr.requestMemory());
assertEquals(BYTES_10_MB, mgr.requestMemory());
assertEquals(BYTES_5_MB, mgr.requestMemory());
assertEquals(30 * BYTES_MB, mgr.requestMemory());
assertEquals(5 * BYTES_MB, mgr.requestMemory());
assertEquals(0, mgr.requestMemory());

mgr.free(BYTES_10_MB);

assertEquals(BYTES_10_MB, mgr.requestMemory());
mgr.free(10 * BYTES_MB);
assertEquals(10 * BYTES_MB, mgr.requestMemory());
mgr.free(31 * BYTES_MB);
assertEquals(30 * BYTES_MB, mgr.requestMemory());
}

}

0 comments on commit de6652f

Please sign in to comment.