#888 closed defect (fixed)

Fuse system tests in contrib/fuse/runtests.py are broken

Reported by: francois Owned by: francois
Priority: major Milestone: 1.6.0
Component: unknown Version: 1.5.0
Keywords: fuse test cleanup Cc:
Launchpad Bug:

Description

Zooko advised me to run the Fuse tests to see if they pass after #811 was fixed. This is unfortunately not the case because a of a couple problems.

  1. runtests.py is being too picky about warning printed on stdout, this is addressed by #876.
  1. tahoe nodes are not correctly configured because runtests.py uses the old configuration method, e.g. it creates a webport file instead of editing tahoe.cfg. This is addressed by this ticket.

Attachments (1)

fix-bug-888.dpatch (35.8 KB) - added by francois at 2010-01-09T12:43:51Z.

Download all attachments as: .zip

Change History (13)

comment:1 Changed at 2010-01-09T11:39:14Z by francois

  • Owner changed from nobody to francois
  • Status changed from new to assigned

Changed at 2010-01-09T12:43:51Z by francois

comment:2 Changed at 2010-01-09T13:02:03Z by francois

  • Keywords review-needed added

With this patch applied on top of the patches from #881 and #876, I can finally run 'make fuse-test' from the tahoe codebase.

$ make fuse-test 2> /dev/null| fgrep "Test Results"
*** Test Results implementation impl_c_no_split: 2 failed out of 12.
*** Test Results implementation impl_a: 5 failed out of 5.
*** Test Results implementation impl_c: 2 failed out of 12.
*** Test Results implementation impl_b: 5 failed out of 5.

There's something weird with the 'impl_c' test because running 'make fuse-test' multiple times doesn't always lead to same number of failed tests. This number varies between 1 and 3. Other tickets will be opened to deal with that as soon as I figure out what makes those tests break.

Anyway, this patch is ready for review.

comment:3 follow-up: Changed at 2010-01-15T01:41:31Z by davidsarah

content = re.sub('%s = (.+)' % key, '%s = %s' % (key, value), content)

What if %s = (.+) matches a partial line?

comment:4 in reply to: ↑ 3 ; follow-up: Changed at 2010-01-15T02:24:50Z by davidsarah

Replying to davidsarah:

content = re.sub('%s = (.+)' % key, '%s = %s' % (key, value), content)

What if %s = (.+) matches a partial line?

The docs for re.sub seem to say that it can. Brian on IRC suggested that the test should probably be creating a new tahoe.cfg rather than editing an existing one (the only fields needed seem to be web.port and introducer.furl.

comment:5 in reply to: ↑ 4 ; follow-up: Changed at 2010-01-19T09:16:20Z by francois

Replying to davidsarah:

What if %s = (.+) matches a partial line?

The docs for re.sub seem to say that it can.

According to the documentation, the '+' qualifier is greedy by default. I don't see how a partial line could be matched.

Brian on IRC suggested that the test should probably be creating a new tahoe.cfg rather than editing an existing one (the only fields needed seem to be web.port and introducer.furl.

Won't it break more easily in the future if new mandatory configuration directives were to be added by tahoe create-client?

comment:6 Changed at 2010-01-19T14:12:00Z by zooko

I don't care either way -- if the test code breaks due to a new configuration directive then we can fix it at that time, but on the other hand the current use of ((.+) is correct and we could accept it. (Besides which "this is just test code" -- if the (.+) matches on a partial line then the worst that would happen is that the tests would spuriously fail and we would notice and fix it.)

David-Sarah: have you reviewed the rest of the patch? Any other issues with it?

comment:7 in reply to: ↑ 5 Changed at 2010-01-20T00:41:31Z by davidsarah

Replying to francois:

Replying to davidsarah:

What if %s = (.+) matches a partial line?

The docs for re.sub seem to say that it can.

According to the documentation, the '+' qualifier is greedy by default. I don't see how a partial line could be matched.

It can match starting part-way through a line. To be correct it should be ^%s = (.+)$ with the MULTILINE flag specified. (The $ isn't necessary except for clarity, because . doesn't match a newline. The ^ is necessary, though.)

However, I suggest using the option-based approach described below instead.

Brian on IRC suggested that the test should probably be creating a new tahoe.cfg rather than editing an existing one (the only fields needed seem to be web.port and introducer.furl.

Won't it break more easily in the future if new mandatory configuration directives were to be added by tahoe create-client?

It would be better still to use the --webport= and --introducer= options when creating the node. I.e. something like

  if clientnum == 0:
      # The first client is special:
      self.clientbase = base
      self.port = random.randrange(1024, 2**15)
      webport = 'tcp:%d:interface=127.0.0.1\n' % (self.port,)
      self.weburl = "http://127.0.0.1:%d/" % (self.port,)
      print self.weburl
  else:
      webport = 'none'

  introfurl_path = os.path.join(introbase, 'introducer.furl')
  furl = open(introfurl_path).read().strip()

  output = self.run_tahoe('create-client',
                          '--basedir', base,
                          '--webport=%s' % (webport,),
                          '--introducer=%s' % (furl,))

comment:8 Changed at 2010-01-20T21:57:23Z by davidsarah

  • Keywords cleanup added

There are also a few pyflakes warnings for runtests.py, that might as well be fixed while we're changing it:

contrib\fuse\runtests.py:144: local variable 'target' is assigned to but never used
contrib\fuse\runtests.py:161: local variable 'se' is assigned to but never used
contrib\fuse\runtests.py:759: local variable 'e' is assigned to but never used

(line numbers might be slightly off).

comment:9 Changed at 2010-01-24T21:30:09Z by francois

David-Sarah: Thanks for your advise! I'm not sure I'll be able to rewrite this patch before 1.6 though. Anyway, the next tine I'll touch this test script, I'll use that.

comment:10 Changed at 2010-01-26T01:22:56Z by zooko

David-Sarah has suggested some good improvements, and François intends to implement them next time he touches this code. For most Tahoe-LAFS code we would tend to leave the patch out of trunk until the better version is implemented, but this is for contrib and I'm going to apply this patch, because fuse tests are broken in Tahoe-LAFS v1.5 so this can't possibly cause a regression.

comment:11 Changed at 2010-01-26T01:50:24Z by zooko

  • Resolution set to fixed
  • Status changed from assigned to closed

fixed by d0c6aa569d965b3d but a better version of this patch would be nice. Thanks, François and David-Sarah!

comment:12 Changed at 2010-01-29T20:52:55Z by davidsarah

  • Keywords review-needed removed
Note: See TracTickets for help on using tickets.