-
Notifications
You must be signed in to change notification settings - Fork 9
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
WIP: Feat/tck #33
WIP: Feat/tck #33
Conversation
6c31f18
to
d5cc91c
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -17,7 +17,7 @@ jobs: | |||
run: sbt publishLocal | |||
- name: Run test | |||
id: test | |||
run: JAVA_OPTS="--enable-preview" sbt test | |||
run: JAVA_OPTS="--enable-preview" sbt "project thoth-core" test && sbt "project thoth-jooq" test && sbt "project thoth-jooq-async" test && sbt "project thoth-kafka-goodies" test && sbt "project thoth-tck" test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ease tests debug with github actions (otherwise logs are mixed up)
thoth-core/src/main/java/fr/maif/eventsourcing/impl/KafkaEventPublisher.java
Show resolved
Hide resolved
stop.toCompletableFuture().join(); | ||
assertThat(isStopping.get()).isTrue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid race condition : once in a while, isStopping is not yet set to true right after "stop" call
@@ -196,7 +196,7 @@ public void eventConsumptionWithEventFromDb() throws IOException { | |||
assertThat(events).hasSize(6); | |||
|
|||
verify(eventStore, times(1)).markAsPublished(any(), Mockito.<List<EventEnvelope<TestEvent, Void, Void>>>any()); | |||
verify(eventStore, times(1)).markAsPublished(Mockito.<List<EventEnvelope<TestEvent, Void, Void>>>any()); | |||
verify(eventStore, atLeastOnce()).markAsPublished(Mockito.<List<EventEnvelope<TestEvent, Void, Void>>>any()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a race condition here as well, perhaps in some cases akka loads events from DB in two batchs ?
de1f5f0
to
cf34d70
Compare
thoth-core/src/main/java/fr/maif/eventsourcing/impl/KafkaEventPublisher.java
Show resolved
Hide resolved
try { | ||
return eventStore.loadAllEvents().runWith(Sink.seq(), actorSystem).toCompletableFuture().get(); | ||
} catch (InterruptedException e) { | ||
throw new RuntimeException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can group it catch (InterruptedException | ExecutionException e)
for(EventEnvelope<TestEvent, Tuple0, Tuple0> env: envelopes) { | ||
if(result.stream().noneMatch(env2 -> env2.id.equals(env.id))) { | ||
result.add(env); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return envelopes.distinctBy(env -> env.id);
No description provided.