Guest User

Untitled

a guest
Apr 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. diff --git a/t/05-scheduler-dependencies.t b/t/05-scheduler-dependencies.t
  2. index 81771028..766d9182 100644
  3. --- a/t/05-scheduler-dependencies.t
  4. +++ b/t/05-scheduler-dependencies.t
  5. @@ -714,11 +714,12 @@ is_deeply($jobD2_h->{parents}->{Chained}, [$jobA2->id], 'jobD2 has jobA2 as chai
  6. is($jobD2_h->{settings}{TEST}, $jobD->TEST, 'jobD2 test and jobD test are equal');
  7.  
  8. my $jobA2_h = job_get_deps($jobA2->id);
  9. -is_deeply(
  10. - $jobA2_h->{children}->{Chained},
  11. - [$jobB2_h->{id}, $jobC2_h->{id}, $jobD2_h->{id}],
  12. - 'jobA2 has jobB2, jobC2 and jobD2 as children'
  13. -);
  14. +my @a_ = @{$jobA2_h->{children}->{Chained}};
  15. +my @b_ = @{[$jobB2_h->{id}, $jobC2_h->{id}, $jobD2_h->{id}]};
  16. +@a_ = sort { $a <=> $b } @a_;
  17. +@b_ = sort { $a <=> $b } @b_;
  18. +note explain (\@a_, \@b_);
  19. +is_deeply(\@a_, \@b_, 'jobA2 has jobB2, jobC2 and jobD2 as children') or diag explain (\@a_, \@b_);
  20.  
  21. # situation parent is done, children running -> parent is cloned -> parent is running -> parent is cloned. Check all children has new parent:
  22. # A <- B
  23. @@ -778,19 +779,20 @@ $jobB = _job_create(\%settingsB, undef, [$jobA->id]);
  24. $jobC = _job_create(\%settingsC, [$jobB->id], [$jobA->id]);
  25. $jobD = _job_create(\%settingsD, [$jobB->id], [$jobA->id]);
  26.  
  27. +$ENV{'DBIC_TRACE'}=1;
  28. # hack jobs to appear done to scheduler
  29. _jobs_update_state([$jobA], OpenQA::Schema::Result::Jobs::DONE, OpenQA::Schema::Result::Jobs::PASSED);
  30. _jobs_update_state([$jobB, $jobC, $jobD], OpenQA::Schema::Result::Jobs::DONE, OpenQA::Schema::Result::Jobs::FAILED);
  31. -
  32. +$schema->storage->debug(1);
  33. $jobA2 = $jobA->auto_duplicate;
  34. $_->discard_changes for ($jobA, $jobB, $jobC, $jobD);
  35. -
  36. # check all children were cloned and has $jobA as parent
  37. for ($jobB, $jobC, $jobD) {
  38. ok($_->clone, 'job cloned');
  39. my $h = job_get_deps($_->clone->id);
  40. is_deeply($h->{parents}{Chained}, [$jobA2->id], 'job has jobA2 as parent');
  41. }
  42. +$schema->storage->debug(0);
  43.  
  44. for ($jobC, $jobD) {
  45. my $h = job_get_deps($_->clone->id);
Add Comment
Please, Sign In to add comment