[ 
https://issues.apache.org/jira/browse/CASSANDRA-10632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15007942#comment-15007942
 ] 

Joel Knighton commented on CASSANDRA-10632:
-------------------------------------------

[~mambocab]

There's another round of text fixes before we will find any C* bugs here.

If you look at the Windows failures, they're actually occurring in 
{{_check_files}} before a cleanup is even attempted.

It expects no temporary files at this point, which is an error, as we know 
there should be some. If we look at how this list of temporary files is 
created, we see it is the set difference of all files and final files.  From 
debug output, we see there are 75 files total and 72 final files, so this 
difference should find three expected files.

If we look at all files and final files after the Windows path handling, it is 
clear a bad and terrifying thing has happened. After Windows file mangling, we 
get paths like:

{code}
dtest: DEBUG: ['g-crc.db', 'g-data.db', 'g-digest.crc32', 'g-filter.db', 
'g-index.db', 'g-statistics.db', 'g-summary.db', 'g-toc.txt', 'g-crc.db', 
'g-data.db', 'g-digest.crc32', 'g-filter.db', 'g-index.db', 'g-statistics.db', 
'g-summary.db', 'g-toc.txt', 'g-crc.db', 'g-data.db', 'g-digest.crc32', 
'g-filter.db', 'g-index.db', 'g-statistics.db', 'g-summary.db', 'g-toc.txt', 
'4-big-crc.db', '4-big-data.db', '4-big-digest.crc32', '4-big-filter.db', 
'4-big-index.db', '4-big-statistics.db', '4-big-summary.db', '4-big-toc.txt', 
'g-crc.db', 'g-data.db', 'g-digest.crc32', 'g-filter.db', 'g-index.db', 
'g-statistics.db', 'g-summary.db', 'g-toc.txt', 'g-crc.db', 'g-data.db', 
'g-digest.crc32', 'g-filter.db', 'g-index.db', 'g-statistics.db', 
'g-summary.db', 'g-toc.txt', '7-big-crc.db', '7-big-data.db', 
'7-big-digest.crc32', '7-big-filter.db', '7-big-index.db', 
'7-big-statistics.db', '7-big-summary.db', '7-big-toc.txt', 'g-crc.db', 
'g-data.db', 'g-digest.crc32', 'g-filter.db', 'g-index.db', 'g-statistics.db', 
'g-summary.db', 'g-toc.txt', 'g-crc.db', 'g-data.db', 'g-digest.crc32', 
'g-filter.db', 'g-index.db', 'g-statistics.db', 'g-summary.db', 'g-toc.txt']
{code}

This is because lstrip doesn't strip a string from the left, but it in fact 
strips a string as long as the next character is present in the string given as 
an argument.  {{_strip_common_prefix}} needs to be fixed to use a different 
method to strip strings from the left based on absolute match - I suggest just 
removing the number of characters that is the length of the common prefix.

After that, in the comparison, {{expected_tmpfiles}} in {{_check_files}} isn't 
processed the same way, so comparisons will still fail. 
{{_strip_common_prefix}} doesn't work here, since it will likely only contain 
files for one sstable, so the common prefix will match more than expected.

Once these are fixed, I can take another look if there still seem to be any 
problems.





> sstableutil tests failing
> -------------------------
>
>                 Key: CASSANDRA-10632
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10632
>             Project: Cassandra
>          Issue Type: Sub-task
>            Reporter: Jim Witschey
>            Assignee: Jim Witschey
>             Fix For: 3.0.1, 3.1
>
>
> {{sstableutil_test.py:SSTableUtilTest.abortedcompaction_test}} and 
> {{sstableutil_test.py:SSTableUtilTest.compaction_test}} fail on Windows:
> http://cassci.datastax.com/view/win32/job/cassandra-3.0_dtest_win32/100/testReport/sstableutil_test/SSTableUtilTest/abortedcompaction_test/
> http://cassci.datastax.com/view/win32/job/cassandra-3.0_dtest_win32/100/testReport/sstableutil_test/SSTableUtilTest/compaction_test/
> This is a pretty simple failure -- looks like the underlying behavior is ok, 
> but string comparison fails when the leading {{d}} in the filename is 
> lowercase as returned by {{sstableutil}} (see the [{{_invoke_sstableutil}} 
> test 
> function|https://github.com/riptano/cassandra-dtest/blob/master/sstableutil_test.py#L128]),
>  but uppercase as returned by {{glob.glob}} (see the [{{_get_sstable_files}} 
> test 
> function|https://github.com/riptano/cassandra-dtest/blob/master/sstableutil_test.py#L160]).
> Do I understand correctly that Windows filenames are case-insensitive, 
> including the drive portion? If that's the case, then we can just lowercase 
> the file names in the test helper functions above when the tests are run on 
> Windows. [~JoshuaMcKenzie] can you confirm? I'll fix this in the tests if so. 
> If I'm wrong, and something in {{sstableutil}} needs to be fixed, could you 
> find an assignee?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to