Skip to content

IndexShardTests. testIndexCheckOnStartup logging assertion failure #74299

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

Closed
pgomulka opened this issue Jun 18, 2021 · 1 comment · Fixed by #74303
Closed

IndexShardTests. testIndexCheckOnStartup logging assertion failure #74299

pgomulka opened this issue Jun 18, 2021 · 1 comment · Fixed by #74303
Labels
>test-failure Triaged test failures from CI

Comments

@pgomulka
Copy link
Contributor

pgomulka commented Jun 18, 2021

Build scan:
https://gradle-enterprise.elastic.co/s/gr6v5hnejapom
Repro line:
gradlew ':server:test' --tests "org.elasticsearch.index.shard.IndexShardTests.testIndexCheckOnStartup" -Dtests.seed=CFA13989D09C1401 -Dtests.locale=ms-MY -Dtests.timezone=America/North_Dakota/Beulah -Druntime.java=11
Reproduces locally?:
yes, on windows
Applicable branches:
master, on windows
Failure history:
new failure after #74233
Failure excerpt:

java.lang.AssertionError: expected to see failure message but did not
12:42:33     Expected: <true>
12:42:33          but: was <false>
12:42:33         at __randomizedtesting.SeedInfo.seed([CFA13989D09C1401:CE07EC20DA1AD6D9]:0)
12:42:33         at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
12:42:33         at org.elasticsearch.test.MockLogAppender$SeenEventExpectation.assertMatched(MockLogAppender.java:121)
12:42:33         at org.elasticsearch.test.MockLogAppender.assertAllExpectationsMatched(MockLogAppender.java:55)
12:42:33         at org.elasticsearch.index.shard.IndexShardTests.testIndexCheckOnStartup(IndexShardTests.java:3117)

but the logs contain the expected log lines..

12:42:33   1> [2021-06-18T05:42:15,619][WARN ][o.e.i.s.IndexShard       ] [testIndexCheckOnStartup] [index][0] performing expensive diagnostic checks during shard startup [index.shard.check_on_startup=checksum]; these checks should only be enabled temporarily, you must remove this index setting as soon as possible
12:42:33   1> [2021-06-18T05:42:15,625][WARN ][o.e.i.s.IndexShard       ] [testIndexCheckOnStartup] [index][0] check index [failure]
12:42:33   1> checksum passed: _0.cfe
12:42:33   1> checksum passed: _0.si
12:42:33   1> checksum failed: _0.cfs
12:42:33   1> org.apache.lucene.index.CorruptIndexException: checksum failed (hardware problem?) : expected=e72f63ce actual=df4db7c6 (resource=BufferedChecksumIndexInput(MockIndexInputWrapper(NIOFSIndexInput(path="C:\Users\jenkins\workspace\platform-support\91\server\build\testrun\test\temp\org.elasticsearch.index.shard.IndexShardTests_CFA13989D09C1401-001\tempDir-114\indices\_na_\0\index\_0.cfs")))

I wonder if this is windows related. It passes for me on macos

@pgomulka pgomulka added the >test-failure Triaged test failures from CI label Jun 18, 2021
@pgomulka
Copy link
Contributor Author

I dicussed this with @dct and it turns out to be a problem with a regex in MockLogAppender

public MockLogAppender() throws IllegalAccessException {
        super("mock", RegexFilter.createFilter(".*(\n.*)*", new String[0], false, null, null), null, false);
    

DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this issue Jun 18, 2021
Today we filter out multiline log messages on Windows, preventing us
from asserting that they are emitted. This commit replaces some
multi-line log messages with multiple single-line log messages to fix
`IndexShardTests#testIndexCheckOnStartup` on Windows.

Relates elastic#74233
Closes elastic#74299
DaveCTurner added a commit that referenced this issue Jun 18, 2021
Today we filter out multiline log messages on Windows, preventing us
from asserting that they are emitted. This commit replaces some
multi-line log messages with multiple single-line log messages to fix
`IndexShardTests#testIndexCheckOnStartup` on Windows.

Relates #74233
Closes #74299
DaveCTurner added a commit that referenced this issue Jun 18, 2021
Today we filter out multiline log messages on Windows, preventing us
from asserting that they are emitted. This commit replaces some
multi-line log messages with multiple single-line log messages to fix
`IndexShardTests#testIndexCheckOnStartup` on Windows.

Relates #74233
Closes #74299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>test-failure Triaged test failures from CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant