This repository was archived by the owner on Dec 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +18
-11
lines changed
main/java/com/transferwise/common/baseutils/meters/cache
test/java/com/transferwise/common/baseutils/meters/cache Expand file tree Collapse file tree 6 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 2727 max-parallel : 100
2828 matrix :
2929 spring_boot_version :
30- - 3.4.6
31- - 3.5.0
30+ - 3.4.8
31+ - 3.5.4
3232
3333 env :
3434 SPRING_BOOT_VERSION : ${{ matrix.spring_boot_version }}
Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
66and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ 1.14.1] - 2025-07-24
9+
10+ ### Fixed
11+ - Flakiness of equals method in TagsSetArray.
12+
813## [ 1.14.0] - 2025-07-10
914
1015### Changed
Original file line number Diff line number Diff line change 11ext {
2- springBootVersion = " ${ System.getenv("SPRING_BOOT_VERSION") ?: "3.2.2 "} "
2+ springBootVersion = " ${ System.getenv("SPRING_BOOT_VERSION") ?: "3.4.8 "} "
33
44 libraries = [
55 // version defined
6- awaitility : " org.awaitility:awaitility:4.2.2 " ,
7- commonsIo : " commons-io:commons-io:2.17 .0" ,
8- guava : ' com.google.guava:guava:33.3.1 -jre' ,
6+ awaitility : " org.awaitility:awaitility:4.3.0 " ,
7+ commonsIo : " commons-io:commons-io:2.20 .0" ,
8+ guava : ' com.google.guava:guava:33.4.0 -jre' ,
99 jakartaValidationApi : ' jakarta.validation:jakarta.validation-api:3.0.2' ,
1010 javaxValidationApi : " javax.validation:validation-api:2.0.1.Final" ,
1111 roaringBitmap : ' org.roaringbitmap:RoaringBitmap:1.3.0' ,
Original file line number Diff line number Diff line change 1- version =1.14.0
1+ version =1.14.1
Original file line number Diff line number Diff line change @@ -61,9 +61,10 @@ public boolean equals(Object other) {
6161 return Arrays .equals (this .tags , ((ArrayTagsSet ) other ).tags );
6262 }
6363
64+ // Cloning is necessary to avoid Micrometer sorting our own array, making equals method flaky.
6465 @ Override
6566 public Tags getMicrometerTags () {
66- return Tags .of (tags );
67+ return Tags .of (Arrays . copyOf ( tags , tags . length ) );
6768 }
6869 }
6970
Original file line number Diff line number Diff line change @@ -59,13 +59,14 @@ void counterCacheWorksWithTags() {
5959 final var tag2 = Tag .of ("tag2" , "tagValue2" );
6060 final var counterName = "my.test.counter" ;
6161
62- var counter0 = meterCache .counter (counterName , TagsSet .of (tag0 , tag1 ));
63- var counter1 = meterCache .counter (counterName , TagsSet .of (tag0 , tag1 ));
62+ // Notice the reverse order of tags, so that micrometer will be reordering them.
63+ var counter0 = meterCache .counter (counterName , TagsSet .of (tag1 , tag0 ));
64+ var counter1 = meterCache .counter (counterName , TagsSet .of (tag1 , tag0 ));
6465
6566 assertSame (counter0 , counter1 );
6667 assertEquals (1 , meterCache .size ());
6768
68- var counter2 = meterCache .counter (counterName , TagsSet .of (tag1 , tag0 ));
69+ var counter2 = meterCache .counter (counterName , TagsSet .of (tag0 , tag1 ));
6970 //Even when cache is different, the underlying meterRegistry provides same counter.
7071 assertSame (counter0 , counter2 );
7172 assertEquals (2 , meterCache .size ());
You can’t perform that action at this time.
0 commit comments