Skip to content

Commit

Permalink
Merge pull request #857 from dsmf/chore/fix-flaky-test
Browse files Browse the repository at this point in the history
chore(test): [#xxx] Fix flaky test
  • Loading branch information
ds-jhartmann authored Jul 29, 2024
2 parents f0098f4 + d7a829d commit ce1fd22
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ _**For better traceability add the corresponding GitHub issue number in each cha
- Improved exception handling concerning invalid date format in search parameters for `GET /irs/policies/paged`. #639
- Change policy to include full namespace `https://w3id.org/catenax/policy/` instead of `cx-policy:`
in some remaining code places (in context of #794).
- Fixed flaky test `InMemoryJobStoreTest.checkLastModifiedOnAfterCreation()` (PR#857).

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.assertj.core.api.SoftAssertions;
import org.eclipse.tractusx.irs.component.Job;
import org.eclipse.tractusx.irs.component.JobErrorDetails;
import org.eclipse.tractusx.irs.component.Jobs;
import org.eclipse.tractusx.irs.component.enums.JobState;
import org.eclipse.tractusx.irs.util.TestMother;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -455,14 +454,15 @@ void create_and_findAll_jobs() {
}

@Test
void checkLastModifiedOnAfterCreation() {
void checkLastModifiedOnAfterCreation() throws InterruptedException {
// Arrange
sut.create(job);
MultiTransferJob job1 = job.toBuilder().build();
final MultiTransferJob job1 = job.toBuilder().build();

// Act
Thread.sleep(1);
sut.addTransferProcess(job.getJobId().toString(), processId1);
MultiTransferJob job2 = sut.find(job.getJob().getId().toString()).get();
final MultiTransferJob job2 = sut.find(job.getJob().getId().toString()).get();

// Assert
assertThat(job2.getJob().getLastModifiedOn()).isAfter(job1.getJob().getLastModifiedOn());
Expand Down

0 comments on commit ce1fd22

Please sign in to comment.