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

Add logging for flaky test #157

Merged
merged 1 commit into from
Jan 10, 2024
Merged

Conversation

willmostly
Copy link
Contributor

To address 123, we need to first add logging to determine if the file change is detectable by comparing timestamps with millisecond precision.

@cla-bot cla-bot bot added the cla-signed label Jan 10, 2024
Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

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

Good for now .. over time we should fix and also change assertions to use assertj

@mosabua mosabua merged commit 55fb758 into trinodb:main Jan 10, 2024
1 check passed
@@ -123,6 +127,9 @@ public void testByRoutingRulesEngineFileChange()
+ "actions:\n"
+ " - \"result.put(\\\"routingGroup\\\", \\\"etl\\\")\"");
fw.close();
file.getPath();
long etlLastModified = file.lastModified();
log.info("etl rule file created at: " + etlLastModified);
Copy link
Member

Choose a reason for hiding this comment

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

No need to change as temporal code, but we cloud use logger template:

        log.info("etl rule file created at: {}", etlLastModified);

@@ -147,6 +154,9 @@ public void testByRoutingRulesEngineFileChange()
+ "actions:\n"
+ " - \"result.put(\\\"routingGroup\\\", \\\"etl2\\\")\""); // change from etl to etl2
fw.close();
long etl2LastModified = file.lastModified();
log.info("etl2 rule file created at: " + etl2LastModified);
assertNotEquals(etl2LastModified, etlLastModified);
Copy link
Member

Choose a reason for hiding this comment

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

nit: We could include message in assertion method instead of logging:

assertNotEquals(long unexpected, long actual, String message)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants