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

test failures (missing data dir) #4

Closed
AndyNewmanCRIBL opened this issue Feb 13, 2024 · 1 comment
Closed

test failures (missing data dir) #4

AndyNewmanCRIBL opened this issue Feb 13, 2024 · 1 comment

Comments

@AndyNewmanCRIBL
Copy link

andy@Andy-laptop ~/src/interview/Cribl-Log-Collector-Interview (main) $ ./mvnw test

...
...
...

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.650 s -- in com.cribl.logcollector.SpringBootApplicationTests
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   CriblFileWatcherTest.setUp:37 » NoSuchFile data/test.txt
[INFO] 
[ERROR] Tests run: 3, Failures: 0, Errors: 1, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.665 s
[INFO] Finished at: 2024-02-13T10:44:28-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.1.2:test (default-test) on project CriblLogCollector: 
[ERROR] 
[ERROR] Please refer to /home/andy/src/interview/Cribl-Log-Collector-Interview/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

running ./mvnw test
results in a failure with NoSuchFile data/test.txt

paulsena added a commit that referenced this issue Feb 13, 2024
…ew/issues :

- #4 Updated unit test to use /logs/ directory instead of data. This was a refactor miss.

- #3 Fixed caching of results with numEntries request parameter. Checks cached list count is below request line number, if not, request the file watcher to run again.
  If below, use previous cached value and limits list count to requested. Caveat here to get efficient caching is that we limit before we filter.

- Enhancement: Added extra validation on numEntries parameter to check that it's within range of allowed values. Use a property to set max request able. Default 100.
  A user could potentially exploit this to read max number of lines on a multi-gig file and cause a memory issue.
@paulsena
Copy link
Owner

paulsena commented Feb 13, 2024

Thank you for the feedback. Fixed remnants of old directory name due to renaming from data->logs

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

No branches or pull requests

2 participants